개인적인 정리

[Oralce] NULLIF() 본문

DB/ORACLE

[Oralce] NULLIF()

yeon.Biju 2020. 4. 13. 13:06

오라클 NULLIF()

 

NULLIF()

   -

 

NULLIF(expr1, expr2)

의 형태 

 

NULLIF compares expr1 and expr2. If they are equal, then the function returns null. If they are not equal, then the function returns expr1. You cannot specify the literal NULL for expr1.

 

If both arguments are numeric data types, then Oracle Database determines the argument with the higher numeric precedence, implicitly converts the other argument to that data type, and returns that data type. If the arguments are not numeric, then they must be of the same data type, or Oracle returns an error.

 

The NULLIF function is logically equivalent to the following CASE expression:

 

CASE WHEN expr1  = expr2 THEN NULL ELSE expr1 END

 

 

 

SQL> SELECT NULLIF('A', 'A') FROM DUAL ;

   ---> 

 

SELECT NULLIF('A', 'C') FROM DUAL ;

   --> A

'DB > ORACLE' 카테고리의 다른 글

[Oracle]NVL2()  (0) 2020.04.13
[Oracle] NVL()  (0) 2020.04.13
[Oracle] NUMTOYMINTERVAL()  (0) 2020.04.13
[Oracle]NUMTODSINTERVAL()  (0) 2020.04.13
[Oracle] NTILE()  (0) 2020.04.13
[Oracle] NTH_VALUE()  (0) 2020.04.10
[Oracle] NEXT_DAY()  (0) 2020.04.10
[Oracle] NCHR()  (0) 2020.04.10
Comments