mv_max.asciidoc 892 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [discrete]
  2. [[esql-mv_max]]
  3. === `MV_MAX`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/mv_max.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `v`::
  9. Multivalue expression.
  10. *Description*
  11. Converts a multivalued expression into a single valued column containing the
  12. maximum value.
  13. include::types/mv_max.asciidoc[]
  14. *Examples*
  15. [source.merge.styled,esql]
  16. ----
  17. include::{esql-specs}/math.csv-spec[tag=mv_max]
  18. ----
  19. [%header.monospaced.styled,format=dsv,separator=|]
  20. |===
  21. include::{esql-specs}/math.csv-spec[tag=mv_max-result]
  22. |===
  23. It can be used by any column type, including `keyword` columns. In that case
  24. it picks the last string, comparing their utf-8 representation byte by byte:
  25. [source.merge.styled,esql]
  26. ----
  27. include::{esql-specs}/string.csv-spec[tag=mv_max]
  28. ----
  29. [%header.monospaced.styled,format=dsv,separator=|]
  30. |===
  31. include::{esql-specs}/string.csv-spec[tag=mv_max-result]
  32. |===