MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a day (or many days) from a given date.
Here’s an example of subtracting a day from a date in MariaDB.
Continue readingDatabase Management Systems
MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a day (or many days) from a given date.
Here’s an example of subtracting a day from a date in MariaDB.
Continue readingHere are several ways to get a list of functions in Oracle Database.
Continue readingIn Oracle Database, we can use the TH
format element to add the ordinal number suffix to the result of a TO_CHAR()
operation when formatting dates.
For example, instead of outputting 10 Feb
we could output 10th Feb
. Or, instead of outputting 21 century
, we can output 21st century
. The same applies for spelled date components. For example, instead of Twenty One
, we can output Twenty First
.
If you need to find the collations that are available in your MariaDB installation, check out the following three methods.
Continue readingIf you need to return all rows that contain at least one numerical digit in MySQL, the following example might come in handy.
Continue readingHere are five options for dealing with error Msg 8134 “Divide by zero error encountered” in SQL Server.
Continue readingWhen 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.
Continue readingIn Oracle Database, the following NLS parameters can be used to determine how currencies are displayed for the current session:
NLS_CURRENCY
specifies the string to use as the local currency symbol for the L
number format element. NLS_ISO_CURRENCY
determines what to use for the C
format element.NLS_DUAL_CURRENCY
specifies what to use for the U
format 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.
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 (-
).
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.