skip to main content
Non-Supported SQL-92 functionality : Value expressions : Advanced value expressions : COALESCE
 

COALESCE

Coalesce is shorthand for a frequently used variation of CASE.

Syntax 

COALESCE (value1, value2, value3)
is equivalent to
CASE
WHEN value1 IS NOT NULL THEN value1
WHEN value2 IS NOT NULL THEN value2
ELSE value3
END

Example 

SELECT name, job_title, COALESCE (salary, commission, subsistence)
FROM job_assignments