mv_max.asciidoc 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. *Supported types*
  14. include::types/mv_max.asciidoc[]
  15. *Examples*
  16. [source.merge.styled,esql]
  17. ----
  18. include::{esql-specs}/math.csv-spec[tag=mv_max]
  19. ----
  20. [%header.monospaced.styled,format=dsv,separator=|]
  21. |===
  22. include::{esql-specs}/math.csv-spec[tag=mv_max-result]
  23. |===
  24. It can be used by any column type, including `keyword` columns. In that case
  25. it picks the last string, comparing their utf-8 representation byte by byte:
  26. [source.merge.styled,esql]
  27. ----
  28. include::{esql-specs}/string.csv-spec[tag=mv_max]
  29. ----
  30. [%header.monospaced.styled,format=dsv,separator=|]
  31. |===
  32. include::{esql-specs}/string.csv-spec[tag=mv_max-result]
  33. |===