least()

Returns the lowest value of the set of input parameters

Reference: DuckDB 1.3.2

Arguments & returns

least(arg1, …)

Scalar
Overload link arg1 … Varargs Returns
#01 ANY ANY ANY

… accepts a variable number of arguments of the type shown.

least example
SQL
Haybarn WASM 2.0.0-rc12 · In your browser

Engine example · Run to view results.

More examples

least example 2
SQL
Haybarn WASM 2.0.0-rc12 · In your browser

Engine example · Run to view results.

In other engines

Snowflakeleast_ignore_nulls()

SELECT LEAST_IGNORE_NULLS(1, 2)
In DuckDB
SELECT LEAST(1, 2)

SQLGlot example ↗

Used in larger rewrites 1

These examples use least as one part of a larger SQL translation.

BigQueryleast()

SELECT LEAST(1, NULL, 3)
In DuckDB
SELECT CASE WHEN 1 IS NULL OR NULL IS NULL OR 3 IS NULL THEN NULL ELSE LEAST(1, NULL, 3) END

SQLGlot example ↗