NVL2 FUNCTION
The NVL function which checks for the existence of NULL values. NVL2 which checks for the existence of NOT NULL. The syntax for this function is as follows.
NVL2(exp1,exp2,exp3);
If exp1 is not null then the function will return exp2. Otherwise, the function will return exp3.
Example:
Select empno,ename,sal,comm,nvl2(comm,1,0)
from emp order by empno;