In MySQL, the BIT_XOR()
function returns the bitwise XOR
of all bits in a given expression.
XOR
is an exclusive OR
, and so a XOR b
is mathematically equal to (a AND (NOT b)) OR ((NOT a) and b)
.
In MySQL, the BIT_XOR()
function returns the bitwise XOR
of all bits in a given expression.
XOR
is an exclusive OR
, and so a XOR b
is mathematically equal to (a AND (NOT b)) OR ((NOT a) and b)
.
In MySQL, the BIT_OR()
function returns the bitwise OR
of all bits in a given expression.
In MySQL, the BIT_AND()
function returns the bitwise AND
of all bits in a given expression.
MySQL provides us with a bunch of functions that can modify JSON values. Here are ten functions that we can use to modify JSON values in MySQL.
Continue readingMySQL includes some inbuilt functions that can be used to create JSON values, such as JSON arrays, JSON objects, or a quoted string literal.
Here are seven functions that allow us to create JSON values in MySQL.
Continue readingBelow is a list of the JSON functions and operators available in MySQL.
Continue readingIn MySQL, the JSON_SCHEMA_VALIDATION_REPORT()
function validates a JSON document against a JSON schema and returns a report of the outcome of that validation. The report is returned as a JSON document.
If the document is valid, only one field is returned: "valid" : true
. If the document is not valid, a more extensive report is provided.
A common task when working with numbers is to format them to a certain amount of decimal places. Two decimal places seems to be the most common format, but we can format to any number of decimal places we want. MySQL provides us with a number of functions that can help us achieve this.
Below are seven functions that can be used to format a number to two decimal places in MySQL.
Continue readingIn MySQL, the JSON_SCHEMA_VALID()
function validates a JSON document against a JSON schema. It returns true (1
) if the document is valid, and false (0
) if it is not.
In MySQL, JSON_OVERLAPS()
is a function that tests whether or not two JSON documents have any key-value pairs or array elements in common.
The function returns true (1
) if the documents have any key-value pairs or array elements in common, and false (0
) if they don’t.
The JSON_OVERLAPS()
function was added in MySQL 8.0.17.