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. Also You May Like: RTRIM and LTRIM Functions in SQL
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
Read more at: