NULLIF
Compare two expressions and return NULL if they are equal. If the expressions differ, the function returns the first expression.
Syntax
NULLIF(expr1,expr2)Description
Examples
SELECT NULLIF(1,1);
+-------------+
| NULLIF(1,1) |
+-------------+
| NULL |
+-------------+
SELECT NULLIF(1,2);
+-------------+
| NULLIF(1,2) |
+-------------+
| 1 |
+-------------+See Also
Last updated
Was this helpful?

