mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 01:44:36 -04:00
parent
04a087fe2f
commit
b1818dbdce
3 changed files with 69 additions and 0 deletions
46
docs/reference/sql/functions/conditional.asciidoc
Normal file
46
docs/reference/sql/functions/conditional.asciidoc
Normal file
|
@ -0,0 +1,46 @@
|
|||
[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>, ... )
|
||||
----
|
||||
|
||||
*Input*:
|
||||
|
||||
<1> 1st expression
|
||||
|
||||
<2> 2nd expression
|
||||
|
||||
...
|
||||
|
||||
**N**th expression
|
||||
|
||||
COALESCE can take an arbitrary number of arguments.
|
||||
|
||||
*Output*: one of the expressions or `null`
|
||||
|
||||
.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]
|
||||
----
|
Loading…
Add table
Add a link
Reference in a new issue