Oracle NULLIF() Function:
The Oracle NULLIF() function accepts only two arguments. If the both arguments are equal it returns a null value. In case the arguments are not equal, the NULLIF() function returns the first argument and if any arguments will null then function return an error.
- Syntax of the NULLIF() function:
NULLIF(elm1, elm2)
Example 1:
SELECT
NULLIF ('VIKAS', 'PANDEY') COL
FROM DUAL
Example 2:
SELECT
NULLIF ('VIKAS', 'VIKAS') COL
FROM DUAL
Example 3:
SELECT
NULLIF (null, 'VIKAS') COL
FROM DUAL