メインコンテンツまでスキップ

null_or_empty

null_or_empty

概要

この関数は、文字列が空であるかまたはNULLである場合にはtrueを返します。それ以外の場合はfalseを返します。

構文

BOOLEAN NULL_OR_EMPTY (VARCHAR str)

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 |
+--------------------+

キーワード

NULL_OR_EMPTY