你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
coalesce()
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Evaluates a list of expressions and returns the first non-null (or non-empty for string) expression.
Syntax
coalesce(
arg,
arg_2,[
arg_3,...])
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
arg | scalar | ✔️ | The expression to be evaluated. |
Note
- All arguments must be of the same type.
- Maximum of 64 arguments is supported.
Returns
The value of the first arg whose value isn't null (or not-empty for string expressions).
Example
print result=coalesce(tolong("not a number"), tolong("42"), 33)
Output
result |
---|
42 |