coalesce.asciidoc 509 B

12345678910111213141516171819202122232425262728293031
  1. [discrete]
  2. [[esql-coalesce]]
  3. === `COALESCE`
  4. *Syntax*
  5. [source,esql]
  6. ----
  7. COALESCE(expression1 [, ..., expressionN])
  8. ----
  9. *Parameters*
  10. `expressionX`::
  11. Expression to evaluate.
  12. *Description*
  13. Returns the first of its arguments that is not null. If all arguments are null,
  14. it returns `null`.
  15. *Example*
  16. [source.merge.styled,esql]
  17. ----
  18. include::{esql-specs}/null.csv-spec[tag=coalesce]
  19. ----
  20. [%header.monospaced.styled,format=dsv,separator=|]
  21. |===
  22. include::{esql-specs}/null.csv-spec[tag=coalesce-result]
  23. |===