SelectDB Enterprise
参考手册
SQL 函数
标量函数
条件函数
NOT_NULL_OR_EMPTY

NOT_NULL_OR_EMPTY

描述

not_null_or_empty 函数用于判断给定的值是否为非 NULL 且非空。如果输入值不为 NULL 且不为空,则返回 true;否则返回 false。

语法

NOT_NULL_OR_EMPTY (<str>)

参数

参数说明
<str>字符串类型

返回值

如果字符串为空字符串或者 NULL,返回 false;否则返回 true。

举例

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 |
+------------------------+
© 2025 北京飞轮数据科技有限公司 京ICP备2022004029号 | Apache、Apache Doris 以及相关开源项目名称均为 Apache 基金会商标