elasticsearch/docs/reference/esql/functions/mv_max.asciidoc

44 lines
892 B
Plaintext

[discrete]
[[esql-mv_max]]
=== `MV_MAX`
*Syntax*
[.text-center]
image::esql/functions/signature/mv_max.svg[Embedded,opts=inline]
*Parameters*
`v`::
Multivalue expression.
*Description*
Converts a multivalued expression into a single valued column containing the
maximum value.
include::types/mv_max.asciidoc[]
*Examples*
[source.merge.styled,esql]
----
include::{esql-specs}/math.csv-spec[tag=mv_max]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/math.csv-spec[tag=mv_max-result]
|===
It can be used by any column type, including `keyword` columns. In that case
it picks the last string, comparing their utf-8 representation byte by byte:
[source.merge.styled,esql]
----
include::{esql-specs}/string.csv-spec[tag=mv_max]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/string.csv-spec[tag=mv_max-result]
|===