v.21.2New Features

Add Tuple Argument Support to argMin and argMax Functions

Add support of tuple argument to argMin and argMax functions. #17359 (Ildus Kurbangaliev).
Add support for tuple arguments in the argMin and argMax aggregate functions in ClickHouse.

Why it matters

This feature enables users to pass tuples as arguments to the argMin and argMax functions, allowing more complex criteria for determining minimum or maximum values along with their corresponding arguments. It enhances flexibility in queries involving multi-column key comparisons.

How to use it

Use the argMin and argMax functions by passing a tuple as the argument to retrieve the corresponding value associated with the minimum or maximum tuple key. Example usage: argMin(value, (col1, col2)) or argMax(value, (colA, colB)).