NULLIF(exp1, exp2)

If exp1 equals exp2, then NULL is returned, otherwise exp1 is returned.

 

Example:

SELECT NULLIF(123, 123) returns NULL

SELECT NULLIF(123, 234) returns 123