Back to Starrocks

null_or_empty

docs/en/sql-reference/sql-functions/string-functions/null_or_empty.md

4.1.01012 B
Original Source

null_or_empty

This function returns true when the string is empty or NULL. Otherwise, it returns false.

Syntax

Haskell
BOOLEAN NULL_OR_EMPTY (VARCHAR str)
BOOLEAN NULL_OR_EMPTY (any_array)

Examples

Plain
MySQL > select null_or_empty(null);
+---------------------+
| null_or_empty(NULL) |
+---------------------+
|                   1 |
+---------------------+

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

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

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

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

keyword

NULL_OR_EMPTY