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

LEAST



Returns the minimum value from a set of values. If any value in the set is NULL, the function returns NULL.

See also: LEAST_IGNORE_NULLS

Syntax

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

Examples

SELECT LEAST(5, 9, 4), LEAST(5, 9, null);
┌────────────────────────────────────┐ │ least(5, 9, 4) │ least(5, 9, NULL) │ ├────────────────┼───────────────────┤ │ 4 │ NULL │ └────────────────────────────────────┘

Was this page helpful?