COALESCE
Purpose
This function returns the first value from the argument list which is not NULL
. If all of the values are NULL
, the function returns
NULL
.
Syntax
coalesce::=
Usage Notes
- The minimum number of arguments is 2.
- The
COALESCE(expr1,expr2)
function is equivalent to theCASE
expressionCASE WHEN expr1 IS NOT NULL THEN expr1 ELSE expr2 END
.