sajad torkamani

What is NULLIF()?

The NULLIF() function returns NULL if the two given expressions are the same, otherwise it returns the first expression.

Syntax

NULLIF(expr1, expr2)

Examples

SELECT NULLIF(1, 1)
-> NULL
SELECT NULLIF(1, 2)
-> 1
Tagged: SQL