NULL_OR_EMPTY
説明
null_or_empty関数は、与えられた値がNULLでなく、かつ空でないかどうかを判定するために使用されます。入力値がNULLでも空でもない場合、trueを返します。それ以外の場合は、falseを返します。
構文
NULL_OR_EMPTY (<str>)
パラメータ
<str>: String型、NULLまたは空かどうかをチェックする文字列。
Return Value
文字列が空文字列またはNULLの場合はtrueを返し、そうでなければfalseを返します。
Examples
-
Example 1
select null_or_empty(null), null_or_empty("");, null_or_empty(" ");+---------------------+-------------------+--------------------+
| null_or_empty(null) | null_or_empty("") | null_or_empty(" ") |
+---------------------+-------------------+--------------------+
| 1 | 1 | 0 |
+---------------------+-------------------+--------------------+