Oracle NVL NVL2 NULLIF

Oracle NVL NVL2 NULLIF
NULL     ,     。
NVL (expr1, expr2)->expr1 NULL, expr2; NULL, expr1。
NVL2 (expr1, expr2, expr3) ->expr1 NULL, expr2; NULL, expr3。expr2 expr3 ,expr3 expr2
select t.empno,nvl2(t.mgr,'the value is not null','the value is null') from emp t where t.deptno in (select s.deptno from dept s where s.deptno='1')
NULLIF (expr1, expr2) -> NULL, expr1
select t.empno,nullif(t.mgr,'tom') from emp t where t.deptno in (select s.deptno from dept s where s.deptno='1')

좋은 웹페이지 즐겨찾기