mv_min.asciidoc 647 B

123456789101112131415161718192021222324252627282930
  1. [[esql-mv_min]]
  2. === `MV_MIN`
  3. Converts a multivalued field into a single valued field containing the minimum value. For example:
  4. [source,esql]
  5. ----
  6. include::{esql-specs}/math.csv-spec[tag=mv_min]
  7. ----
  8. Returns:
  9. [%header,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,esql]
  16. ----
  17. include::{esql-specs}/string.csv-spec[tag=mv_min]
  18. ----
  19. Returns:
  20. [%header,format=dsv,separator=|]
  21. |===
  22. include::{esql-specs}/string.csv-spec[tag=mv_min-result]
  23. |===