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

NOT_NULL_OR_EMPTY

説明

not_null_or_empty関数は、指定された値がNULLでも空でもないかどうかをチェックします。入力値がNULLでなく、かつ空文字列でない場合はtrueを返し、そうでない場合はfalseを返します。

構文

NOT_NULL_OR_EMPTY (<str>)

パラメータ

Parameterデスクリプション
<str>チェックする文字列

Return Value

文字列が空文字列またはNULLの場合はfalseを返し、それ以外の場合はtrueを返します。

Examples

select not_null_or_empty(null);
+-------------------------+
| not_null_or_empty(NULL) |
+-------------------------+
| 0 |
+-------------------------+
select not_null_or_empty("");
+-----------------------+
| not_null_or_empty('') |
+-----------------------+
| 0 |
+-----------------------+
select not_null_or_empty("a");
+------------------------+
| not_null_or_empty('a') |
+------------------------+
| 1 |
+------------------------+