ARRAY_MAX

All functions > ARRAY > ARRAY_MAX

Returns the largest value in an array using natural ordering.

Syntax

ARRAY_MAX(array: ARRAY<T>) → T
sql

Type Parameters:

  • T: Any comparable type that supports ordering

Arguments

ParameterTypeRequiredDescription
arrayARRAY<T>YesThe array to find the maximum value from

Returns

The largest value in the array, or NULL for empty arrays

Notes

  • Returns the maximum element using natural ordering
  • Ignores NULL values when determining the maximum
  • Returns NULL if array is empty or contains only NULL values
  • Works with numbers, strings, dates, or any comparable type
  • Uses lexicographic ordering for strings
Last update at: 2025/10/13 10:23:46