greatest function

Returns the greatest value of all arguments, skipping null values.

Syntax

greatest(expr1 [, ...])

Arguments

  • exprN: Any expression of a comparable type with a shared least common type across all exprN.

Returns

The result type is the least common type of the arguments.

Examples

> SELECT greatest(10, 9, 2, 4, 3);
 10