NULLIF is a newly added function in Oracle 9i.
The format is as follows:
NULLIF(expression1, expression2)
The NULLIF function compares expression1 and expression2.
Returns NULL if the two expressions are equal.
Returns expression1 if not equal.
E.g:
SELECT NAME,JOB,NULLIF(LENGTH(NAME),LENGTH(JOB)) FROM EMP;
When LENGTH(NAME) and LENGTH(JOB) are equal, the function NULLIF(LENGTH(NAME), LENGTH(JOB)) returns null.
Otherwise, return the value of LENGTH(NAME), which is the length of NAME.