NVL (expr1, expr2):expr1为NULL,返回expr2;不为NULL,返回expr1。注意两者的类型要一致
例如: NVL: SQL> select nvl(null, 1) from dual;
NVL(NULL,1) SQL> select nvl(2, 1) from dual;
NVL(2,1) NVL2: SQL> select nvl2(2, 1, 3) from dual;
NVL2(2,1,3) SQL> select nvl2(null, 1, 3) from dual;
NVL2(NULL,1,3) NULLIF: SQL> select NULLIF(1,1) from dual;
NULLIF(1,1)
NULLIF(1,2) |