In MariaDB, the IFNULL()
function allows us to replace NULL values with another value.
Tag: what is
How NVL() Works in MariaDB
From MariaDB 10.3, NVL()
can be used as an alias for the IFNULL()
function. Therefore, both functions enable us to replace NULL values with another value.
MySQL IF() Function Explained
MySQL has an IF()
function that provides a convenient way to perform a simple “IF/ELSE” operation.
It works similar to a basic IF
/ELSE
statement, in that it allows us to check for a condition, and return a different result depending on whether it’s true or not.
More specifically, if the first argument to the IF()
function is true, the second argument is returned. If it’s not true, the third argument is returned.
How COALESCE() Works in MariaDB
In MariaDB, the COALESCE()
operator returns the first non-NULL value in the list, or NULL if there are no non-NULL values.
MySQL NULLIF() Explained
In MySQL, NULLIF()
is a flow control function that returns NULL
if both of its arguments are equivalent. Otherwise it returns the first argument.
JSON_INSERT() vs JSON_SET() vs JSON_REPLACE() in SQLite
SQLite provides several functions for inserting, setting, and replacing values in a JSON document. Specifically, it provides json_insert()
, json_set()
, and json_replace()
.
These functions perform similar tasks, and you can sometimes use them interchangeably to a certain point.
But there is definitely a clear difference between each function.
Continue readingMySQL COALESCE() Explained
In MySQL, the COALESCE()
operator returns the first non-NULL value in the list, or NULL if there are no non-NULL values.
SQL Server COALESCE() Explained
In SQL Server, the COALESCE()
expression returns its first non-null argument.
The way it works is, we pass a list of arguments to the expression, it evaluates the arguments in order and returns the current value of the first expression that initially doesn’t evaluate to NULL
.
Difference Between -> and ->> in SQLite
The ->
and ->>
operators were introduced in SQLite version 3.38.0, which was released on 22 February 2022. Both operators are used for extracting subcomponents of JSON. But there’s a subtle difference between them.
UPPER() – Convert to Uppercase in PostgreSQL
In PostgreSQL, we can use the upper()
function to convert lowercase characters to their uppercase equivalent, according to the rules of the database’s locale.