1、NVL(expr1,expr2)
expr1为空时则返回值为expr2的值,
SELECT last_name,
salary,
commission_pct,
NVL2(commission_pct, salary + (salary * commission_pct), salary) income
FROM employees
WHERE last_name like 'B%'
ORDER BY last_name;
2、NVL2(expr1,expr2,expr3)
expr1值为空时,返回expr3的值,不为空时返回expr2的值
SELECT last_name,
salary,
commission_pct,
NVL(commission_pct,0.5) commission_pct2
FROM employees
WHERE last_name like 'B%'
ORDER BY last_name;