LEAST_IGNORE_NULLS

functionsupportedCore SQL functions

docs.snowflake.com ↗

Conditional expression functions

Returns the smallest non-NULL value from a list of expressions. LEAST_IGNORE_NULLS supports all data types, including VARIANT.

Syntax

LEAST_IGNORE_NULLS( <expr1> [ , <expr2> ... ] )

Parameters

NameRequiredDescription
<exprN>requiredThe arguments must include at least one expression. All the expressions should be of the same type or compatible types.

Returns

The first argument determines the return type: - If the first type is numeric, then the return type is ‘widened’ according to the numeric types in the list of all arguments. - If the first type is not numeric, then all other arguments must be convertible to the first type. If all arguments are NULL, returns NULL.

Collation details

- The collation specifications of all input arguments must be compatible. - The comparisons follow the collation based on the input arguments’ collations and precedences. - The collation of the result of the function is the highest-precedence collation of the inputs.

See also

Referenced by