min([value: storable]+) -> value

Returns the minimum of comparable storable values. With one argument inside a grouping or window() frame, min is an aggregate that ignores null inputs when reducing the group. With two or more arguments, it is a scalar least-style expression: inputs are cast to a common type and the smallest value wins; if any argument is null, the scalar result is null. Supported types include numeric, bool, string, duration, and timestamp values.

Domain

This is an aggregate function (aggregates rows over a group in aggregate verbs).

This is a window function (calculates over a group of multiple input rows using windowing).

Categories

Examples

statsby first_seen:min(timestamp), group_by(user_id)

Finds the earliest timestamp per user with min as an aggregate, ignoring null timestamps in the reduction.

make_col floor:min(price_a, price_b, price_c)

Uses scalar min to pick the smallest of three prices on each row, propagating null if any argument is null.