NULLIFThe NULLIF function compares two arguments expr1 and expr2. If expr1 and expr2 are equal, it returns NULL; else, it returns expr1. Unlike the other null handling function, first argument can't be NULL.
Note that first argument can be an expression that evaluates to NULL, but it can't be the literal NULL. Both the parameters are mandatory for the function to execute.
NULLIF (expr1, expr2)
The below query returns NULL since both the input values, 12 are equal.
Read more: Conv. Func.
SELECT NULLIF (12, 12) FROM DUAL; Similarly, below query return 'SUN' since both the strings are not equal. SELECT NULLIF ('SUN', 'MOON') FROM DUAL;