ARG_MAX
Syntax
Standard
Extended
ARG_MAX( value, comp )
ARG_MAX( value, comp [ FIXED ... | INCLUDE ... | EXCLUDE ... ] [ BEFORE FILTER BY ... ] )
More info:
Description
Returns value
for the maximum value of comp
in the group. If multiple values of value
match the maximum value of comp
, then the first one encountered is returned. This makes the function non-deterministic.
Argument types:
value
—Any
comp
—Any
Return type: Same type as (value
)
Example
ARG_MAX([Sales], [Profit])
Data source support
ClickHouse 21.8
, YDB
.