COALESCE(…expr1…, …expr2…, …)
…expr1… |? …expr2…
(t?, t?, …, t?) -> t?
(t?, t?, …, t) -> t
Accept a list of alternative values of the same type and returns the first one that is not NULL.
All alternatives but the last must be nullable.
If all alternatives are NULL then returns NULL.
expression | evaluates to |
---|---|
NULL |? 1 | 1 |
COALESCE(IF RANDOM > 1 THEN "can't happen", "ok") | "ok" |