Skip to main content

null_or_empty

null_or_empty

Description

Syntax:

BOOLEAN NULL_OR_EMPTY (VARCHAR str)

If str is an empty or null string, this function will return true; otherwise, it will return false.

Example

MySQL [(none)]> select null_or_empty(null);
+---------------------+
| null_or_empty(NULL) |
+---------------------+
| 1 |
+---------------------+

MySQL [(none)]> select null_or_empty("");
+-------------------+
| null_or_empty('') |
+-------------------+
| 1 |
+-------------------+

MySQL [(none)]> select null_or_empty("a");
+--------------------+
| null_or_empty('a') |
+--------------------+
| 0 |
+--------------------+

Keywords

NULL_OR_EMPTY