Declaration
ISNULL(expr)
Description
If the expr parameter is NULL, the ISNULL() function returns 1; otherwise, it returns 0.
The ISNULL() function can be used to replace the equal sign (=) to check whether a value is NULL. (Using the equal sign to compare a value with NULL always returns NULL.) The ISNULL() function has some characteristics in common with the IS NULL comparison operator. For information about the comparison operator, see Comparison operators.
Examples
obclient> SELECT ISNULL(null), ISNULL('test'), ISNULL(123.456), ISNULL('10:00');
+--------------+----------------+-----------------+-----------------+
| ISNULL(null) | ISNULL('test') | ISNULL(123.456) | ISNULL('10:00') |
+--------------+----------------+-----------------+-----------------+
| 1 | 0 | 0 | 0 |
+--------------+----------------+-----------------+-----------------+
1 row in set
obclient> SELECT ISNULL(null+1);
+----------------+
| ISNULL(null+1) |
+----------------+
| 1 |
+----------------+
1 row in set