APPLY_MAX

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

Behavior Type

Immutable

Syntax

APPLY_MAX(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_max(ARRAY[1,3.4,15]);
apply_max
-----------
     15.0
(1 row)