Two similar functions in MariaDB are FIELD()
and FIND_IN_SET()
. At first glance, these appear to do the same thing, but there is a difference.
This article looks at the difference between these two functions.
Continue readingTwo similar functions in MariaDB are FIELD()
and FIND_IN_SET()
. At first glance, these appear to do the same thing, but there is a difference.
This article looks at the difference between these two functions.
Continue readingEver since version 10.3.1, MariaDB has included both a LENGTH()
function and a LENGTHB()
function.
That second one has a B
at the end of the name. So it’s kind of like Length A
and Length B
, except that Length A
doesn’t have the A
.
Confused?
I was, when I first encountered LENGTHB()
. I already knew about LENGTH()
, so why the need for a “B” version?
Let’s find out.
Continue readingBelow is a list of the JSON functions available in MariaDB.
Continue readingYou can use the SWITCHOFFSET()
function in SQL Server to change the time zone offset on a datetimeoffset value.
The function accepts two arguments; a datetimeoffset(n) value (or an expression that can be resolved to a datetimeoffset(n) value), and the new time zone.
Continue readingBelow are 4 functions that enable you to return the hour from a time value in MariaDB.
Continue readingIn SQL Server, the REPLACE()
function enables us to replace a string with another string. But what if you want to replace a list of characters with another list of characters?
The TRANSLATE()
function might help.
MariaDB has quite a number of functions that return the day from a date. It all depends on how you want to do it, and what you mean by “day”.
MariaDB needs to know whether you want the day name, the day of the week number, the day of the month, day of year, etc.
Below are 8 functions that enable you to return the day from a date in MariaDB, in its various forms.
Continue readingIn MariaDB, JSON_VALID()
is a built-in function that allows you to check whether or not a value is a valid JSON document.
You pass the value as an argument, and JSON_VALID()
returns 1
if it’s a valid JSON document, and 0
if not.
In MariaDB, JSON_UNQUOTE()
is a built-in function that removes quotes from a JSON value. In other words, it “unquotes” a JSON value.
In MariaDB, JSON_TYPE()
is a built-in function that returns the type of a JSON value, as a string.