メインコンテンツまでスキップ
バージョン: 2.5

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