.------------------. (1) V | >>-COALESCE-------(--expression-----,--expression---+---)------><
Notes:
The schema is SYSIBM.
COALESCE returns the first argument that is not null.
The arguments are evaluated in the order in which they are specified, and the result of the function is the first argument that is not null. The result can be null only if all the arguments can be null, and the result is null only if all the arguments are null. The selected argument is converted, if necessary, to the attributes of the result.
The arguments must be compatible. See Rules for Result Data Types for what data types are compatible and the attributes of the result. They can be of either a built-in or user-defined data type. 40
Examples:
SELECT DEPTNO, DEPTNAME, COALESCE(MGRNO, 'ABSENT'), ADMRDEPT FROM DEPARTMENT
SELECT EMPNO, COALESCE(SALARY, 0) FROM EMPLOYEE