v.21.1New Features

Added arrayMin, arrayMax, arrayAvg aggregation functions

Added arrayMin, arrayMax, arrayAvg aggregation functions. #18032 (Maksim Kita).
Added new aggregation functions arrayMin, arrayMax, and arrayAvg to aggregate array-type data in ClickHouse.

Why it matters

These functions provide the ability to calculate the minimum, maximum, and average values within arrays during aggregation, simplifying array data analysis and enabling more expressive queries on array columns.

How to use it

Use these functions in aggregation queries by applying arrayMin, arrayMax, or arrayAvg to an array column within the SELECT statement, for example:

SELECT arrayMin(array_column), arrayMax(array_column), arrayAvg(array_column)
FROM table
GROUP BY some_column