Citation :
New COALESCE internal function
Allow a column value to be calculated by a number of expressions, the first expression returning a non NULL value is returned as the column value. The function has the same meaning as NVL in Oracle.
Syntax:
COALESCE (value {, value} ... )Notes:
COALESCE (V1, V2) is equivalent to the following case specification:
CASE WHEN V1 IS NOT NULL THEN V1 ELSE V2 END COALESCE (V1, V2, ..., Vn), for n >= 3, is equivalent to the following case specification:
CASE WHEN V1 IS NOT NULL THEN V1 ELSE COALESCE (V2, ..., Vn) END Example:
SELECT
PROJ_NAME AS Projectname,
COALESCE(e.FULL_NAME, '[> not assigned <]') AS Employeename
FROM
PROJECT p LEFT JOIN EMPLOYEE e ON (e.EMP_NO = p.TEAM_LEADER)
|