If you need to return all rows that contain at least one numerical digit in MySQL, the following example might come in handy.
5 Ways to Fix the “Divide by zero error” in SQL Server (Msg 8134)
Here are five options for dealing with error Msg 8134 “Divide by zero error encountered” in SQL Server.
How the JSONPath Wildcard Step (**) Works in MariaDB
When working with JSON in MariaDB, you can use JSONPath expressions to manipulate data within a JSON document.
One powerful feature that MariaDB provides is the wildcard step (**). This allows you to recursively select all child elements of the current element.
The wildcard step is a non-standard extension, and it’s also supported with the same meaning in MySQL.
Find Out Which Currency Symbol your Session Uses in Oracle
In Oracle Database, the following NLS parameters can be used to determine how currencies are displayed for the current session:
NLS_CURRENCYspecifies the string to use as the local currency symbol for theLnumber format element.NLS_ISO_CURRENCYdetermines what to use for theCformat element.NLS_DUAL_CURRENCYspecifies what to use for theUformat element.
The default value for these is determined by the NLS_TERRITORY parameter.
The L, C, and U number format elements can be used in functions like TO_CHAR() to format a number as a currency.
How to Spell Out the Year when Formatting a Date in Oracle
Oracle Database includes a good selection of datetime format elements. that enable us to format dates and times when using the TO_CHAR(datetime) function.
One of these (the YEAR format element) allows us to format a date with the year spelled out. For example, instead of 1972, we’d get NINETEEN SEVENTY-TWO.
We can also use SYEAR so that BC dates are prefixed with a minus sign (-).
How NULLIF() Works in SQL Server
In SQL Server, the NULLIF() expression checks the value of two specified expressions. It returns a null value if they’re equal, otherwise it returns the first expression.
Set the Language used for Date & Time Functions in MariaDB
MariaDB has a lc_time_names system variable that controls the language used by the DAYNAME(), MONTHNAME() and DATE_FORMAT() date and time functions.
Here’s how to set the value of that variable.
Fix Msg 529 “Explicit conversion from data type int to xml is not allowed” in SQL Server
If you’re getting SQL Server error Msg 529 that reads something like Explicit conversion from data type int to xml is not allowed, it’s probably because you’re trying to perform a data type conversion that’s not permitted.
SQL Server doesn’t allow certain conversions. If you try to perform such a conversion, you’ll get this error.
4 Functions to Return the Month from a Date in MariaDB
Below are 4 functions that enable you to return the month from a date in MariaDB.
DROP TABLE IF EXISTS Example in PostgreSQL
In PostgreSQL, we can use the IF EXISTS clause of the DROP TABLE statement to check whether the table exists or not before dropping it.