跳到主要内容

COALESCE

Checks from left to right whether NULL arguments were passed and returns the first non-NULL argument.

Syntax

COALESCE(x,...)

Arguments

ArgumentsDescription
xThe original value.

Return Type

Returns the first non-NULL argument, returns NULL if all arguments are NULL.

Examples

SELECT COALESCE(NULL, 1, 2);

+----------------------+
| COALESCE(NULL, 1, 2) |
+----------------------+
| 1 |
+----------------------+
这篇文章对您有帮助吗?
Yes
No
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册