📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

GREATEST_IGNORE_NULLS



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 │ └────────────────────────────────────────────────────────────────────┘

Was this page helpful?