ClickHouse/docs/en/sql-reference/aggregate-functions/reference/argmin.md
Ivan Blinkov 7170f3c534
[docs] split aggregate function and system table references (#11742)
* prefer relative links from root

* wip

* split aggregate function reference

* split system tables
2020-06-18 11:24:31 +03:00

689 B

toc_priority
105

argMin

Syntax: argMin(arg, val)

Calculates the arg value for a minimal val value. If there are several different values of arg for minimal values of val, the first of these values encountered is output.

Example:

┌─user─────┬─salary─┐
│ director │   5000 │
│ manager  │   3000 │
│ worker   │   1000 │
└──────────┴────────┘
SELECT argMin(user, salary) FROM salary
┌─argMin(user, salary)─┐
│ worker               │
└──────────────────────┘