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

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

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