Back to Materialize

COALESCE function

doc/user/content/sql/functions/coalesce.md

123428 B
Original Source

COALESCE returns the first non-NULL element provided.

Signatures

ParameterTypeDescription
valAnyThe values you want to check.

Return value

All elements of the parameters for coalesce must be of the same type; coalesce returns that type, or NULL.

Examples

mzsql
SELECT coalesce(NULL, 3, 2, 1) AS coalesce_res;
nofmt
 res
-----
   3