Below is a list of the JSON functions available in MariaDB.
Continue readingCategory: MariaDB
4 Functions to Get the Hour from a Time Value in MariaDB
Below are 4 functions that enable you to return the hour from a time value in MariaDB.
Continue reading8 Functions to Return the Day from a Date in MariaDB
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 readingMariaDB JSON_VALID() Explained
In 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.
MariaDB JSON_UNQUOTE() Explained
In MariaDB, JSON_UNQUOTE()
is a built-in function that removes quotes from a JSON value. In other words, it “unquotes” a JSON value.
MariaDB JSON_TYPE() Explained
In MariaDB, JSON_TYPE()
is a built-in function that returns the type of a JSON value, as a string.
MariaDB JSON_SEARCH() Explained
In MariaDB, JSON_SEARCH()
is a built-in function that allows you to get the path to a given value in a JSON document.
It accepts the JSON document and a string as arguments, and returns the path to the given string within the document.
Continue readingMariaDB JSON_REMOVE() Explained
In MariaDB, JSON_REMOVE()
is a built-in function that removes data from a JSON document and returns the result.
MariaDB JSON_QUOTE() Explained
In MariaDB, JSON_QUOTE()
is a built-in function that produces a valid JSON string literal that can be included in a JSON document.
It wraps the string with double quote characters and escapes interior quotes and other special characters, returning a utf8mb4 string.
Continue readingMariaDB JSON_LOOSE() Explained
In MariaDB, JSON_LOOSE()
is a built-in function that adds spaces to a JSON document to make it more readable.
It’s similar to the JSON_DETAILED()
function, except that it doesn’t emphasise nested structures in the way that JSON_DETAILED()
does.
For the opposite effect (i.e. to remove unnecessary spaces), use the JSON_COMPACT()
function.