MariaDB CASE Operator

In MariaDB, we can use the CASE operator to compare a list of conditions and return a different result depending on which condition (if any) is matched.

The CASE expression is included in the SQL standard (ISO/IEC 9075), and most major RDBMSs support it.

MariaDB also has the CASE statement, which is slightly different to the CASE operator. This article is about the CASE operator.

Read more

Oracle ISNULL() Equivalent

Most major DBMSs provide us with a function for replacing null values with another value.

But the name of the function tends to differ across DBMSs. For example, SQL Server has an ISNULL() function, while others (such as MySQL, MariaDB, and SQLite) have an IFNULL() function for doing the same thing.

However, to confuse matters, MySQL and MariaDB each have an ISNULL() function that works differently to SQL Server’s function of the same name (MySQL and MariaDB’s implementation only accept a single argument, and return 1 if its null and 0 if it’s not).

Read more