Oracle PL/SQL/Conversion Functions/NULLIF
Версия от 13:45, 26 мая 2010; (обсуждение)
NULLIF() compares two expressions. If they are equal, it returns NULL. Otherwise, it returns the first expression.
SQL>
Syntax: NULLIF( <expression1>,<expression2>)
SQL>
SQL> SELECT
2 NULLIF("ABC","ABC") equal,
3 NULLIF ("ABC","DEF") diff from dual;
EQU DIF
--- ---
ABC
select nullif( 1, 1 )
SQL>
SQL> select nullif( 1, 1 )
2 from dual;
NULLIF(1,1)
-----------
1 row selected.
SQL>
SQL> --
select nullif( 1, null )
SQL>
SQL> select nullif( 1, null )
2 from dual;
NULLIF(1,NULL)
--------------
1
1 row selected.
SQL>
SQL>
SQL> --