greatest

Returns the largest of the provided values.

Examples:

examples.sql
SELECT greatest(1, 2, 3) AS value; -- value '3'

Supported Signatures

function greatest($3, ...) returns $3

🔗 Official Documentation

least

Returns the smallest of the provided values.

Examples:

examples.sql
SELECT LEAST(5,6,7,1,2,3,4) -- list of columns or values -- value '1'

Supported Signatures

function least($3, ...) returns $3

🔗 Official Documentation