My SQL Fundamentals 1 Exam Guide states,
select NULLIF(1234, 123+1) from dual;The arithmetic equation is not implicitly evaluated...
However, when I submit the query below the result is null - it seems that 123+1 is evaluated (although I know that the queries are different).
select NULLIF(124, 123+1) from dual;
So, which is correct (for the 1Z0-051 Exam, anyway)? Are expressions evaluated or not?
Nullif()function evaluates both arguments and returnsNULLifargument1equal toargument2. In your case123+1is not equal to1234.123+1is equal to124not1234.It cannot be
nullin your case.FOLLOW UP: My 2 cents
The above
NULLIFis equivalent to the below caseYou cannot specify the literal
NULLfor the first expression.Also from documentation