Sybtax:- - nvl2(expr1,expr2,expr3)In nvl2 if expr1 evaluates to NULL then expr3 is returned and if it evaluates to some value it returns expr2.for e.g select nvl2(commission_pct,'SAL+COMM','SAL') from employees;if commission_pct is having null value then SAL will be displayed else SAL+COMM.
nvl2 function is the upgraded form of nvl function.In nvl function we need to pass two parameters.i.e. nvl(interest_rate ,returned_value) if the value of interest_rate is null then the nvl function returns the value of second parameter 'returned_value'.In nvl2 function we need to pass three parameters .i.e. nvl2 (interest_rate,returned_value_if_not_null,returned_value_if_null)if the value of interest_rate is null then the nvl function returns the value of the third parameter 'returned_value_if_null' else it returns the value of the second parameter 'returned_value_if_not_null'.