APPLY_MIN

Returns the smallest non-null element in a collection (array or set). This function is similar to the MIN [Aggregate] function; APPLY_MIN operates on elements of a collection and MIN operates on an expression such as a column selection.

Behavior Type

Immutable

Syntax

APPLY_MIN(collection)

Supported Data Types

1D collections of any primitive type.

Null-Handling

This function ignores null elements. If all elements are null or the collection is empty, this function returns null.

Example

=> SELECT apply_min(ARRAY[1,3.4,15]);
apply_min
-----------
       1.0
(1 row)