Skip to main content
Version: 24.3.x

Categories: Conditional

GREATEST

Returns the largest value from a list of expressions.

Syntax

GREATEST(expression) → same as input type

  • expression: The arguments must include at least one expression. All the expressions should be of the same type or compatible types. Expressions must be of primitive data types.

Examples

GREATEST example
SELECT GREATEST(1, 5, 3, 8)
-- 8