46 lines
911 B
Plaintext
46 lines
911 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.
|
|
|
|
*Supported types*
|
|
|
|
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]
|
|
|===
|