The NVL function 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.
This SQL will return the names of all departments, along with the manager number. If there is no manager for the department, a value of “ABSENT” is displayed.
SELECT DEPTNO, DEPTNAME, NVL(MGRNO, ‘ABSENT’) AS MGRNO, ADMRDEPT FROM DEPARTMENT
Read more at: DB2- Use of ‘COALESCE’ Function (1 of 2)