mv_min.asciidoc 698 B

12345678910111213141516171819202122232425
  1. [discrete]
  2. [[esql-mv_min]]
  3. === `MV_MIN`
  4. Converts a multivalued field into a single valued field containing the minimum value. For example:
  5. [source.merge.styled,esql]
  6. ----
  7. include::{esql-specs}/math.csv-spec[tag=mv_min]
  8. ----
  9. [%header.monospaced.styled,format=dsv,separator=|]
  10. |===
  11. include::{esql-specs}/math.csv-spec[tag=mv_min-result]
  12. |===
  13. It can be used by any field type, including `keyword` fields. In that case picks the
  14. first string, comparing their utf-8 representation byte by byte:
  15. [source.merge.styled,esql]
  16. ----
  17. include::{esql-specs}/string.csv-spec[tag=mv_min]
  18. ----
  19. [%header.monospaced.styled,format=dsv,separator=|]
  20. |===
  21. include::{esql-specs}/string.csv-spec[tag=mv_min-result]
  22. |===