Skip to main content Skip to complementary content

GREATEST

Returns the greatest value from the list of arguments.

Syntax

GREATEST(VALUE1 [, VALUE2, ..., VALUEN]) 

Arguments

VALUE

Type: double, bigint, string, timestamp, date, array

A value of any of the above types, provided that all values are of the same type.

Returns

Type: same as input

The largest of the provided values.

When the input values are arrays, the greatest element between all the arrays is returned.

If any of the input values are null, the result is null as well.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!