Skip to main content
Version: V1.4.0

ISNULL

Declaration​

ISNULL(expr)

Description​

If the parameter expr is NULL, then the return value of ISNULL() is 1, otherwise it is 0.

The ISNULL() function can be used instead of the equals sign (=) to determine whether a value is NULL. (Using the equals sign to compare a value with NULL always returns NULL) The ISNULL() function shares some characteristics with the IS NULL comparison operator. For more information about comparison operators, see Comparison Operators.

Examples​

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 (0.001 sec)

SELECT ISNULL(null+1);
+----------------+
| ISNULL(null+1) |
+----------------+
| 1 |
+----------------+
1 row in set (0.001 sec)