Skip to main content

GREATEST_IGNORE_NULLS

Introduced or updated: v1.2.738

Returns the maximum value from a set of values, ignoring any NULL values.

See also: GREATEST

Syntax

GREATEST_IGNORE_NULLS(<value1>, <value2> ...)

Examples

SELECT GREATEST_IGNORE_NULLS(5, 9, 4), GREATEST_IGNORE_NULLS(5, 9, null);
┌────────────────────────────────────────────────────────────────────┐
│ greatest_ignore_nulls(5, 9, 4) │ greatest_ignore_nulls(5, 9, NULL)
├────────────────────────────────┼───────────────────────────────────┤
99
└────────────────────────────────────────────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today