Evaluate two expressions
SELECT NULLIF(25, 25); |
The NULLIF() function evaluates two expressions and returns NULL if they are equal; otherwise, it returns the first expression.
NULLIF(expr1, expr2) |
Parameter |
Description |
expr1,expr2 |
Required: The two expressions to compare. |
Works in: |
From MySQL version 4.0 |
Compare two values
SELECT NULLIF(25, “Hello”); |
Compare two values
SELECT NULLIF(“Hello”, “world”); |
Compare two values
SELECT NULLIF(“2017-08-25”, “2017-08-25”); |