forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL: [docs] Add documentation for COALESCE
Follows: elastic#35253
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[sql-functions-conditional]] | ||
=== Conditional Functions | ||
|
||
Functions that return one of their arguments by evaluating in an if-else manner. | ||
|
||
[[sql-functions-conditional-coalesce]] | ||
==== `COALESCE` | ||
|
||
.Synopsis | ||
[source, sql] | ||
---- | ||
COALESCE ( expression<1>, expression<2>, ... ) | ||
---- | ||
|
||
<1> 1st expression | ||
|
||
<2> 2nd expression | ||
|
||
... | ||
|
||
**N**th expression | ||
|
||
COALESCE can take an arbitrary number of arguments. | ||
|
||
|
||
.Description | ||
|
||
Returns the first of its arguments that is not null. | ||
If all arguments are null, then it returns `null`. | ||
|
||
|
||
|
||
["source","sql",subs="attributes,callouts,macros"] | ||
---- | ||
include-tagged::{sql-specs}/docs.csv-spec[coalesceReturnNonNull] | ||
---- | ||
|
||
["source","sql",subs="attributes,callouts,macros"] | ||
---- | ||
include-tagged::{sql-specs}/docs.csv-spec[coalesceReturnNull] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters