HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Compare two expressions
The NULLIF() function compares two expressions and returns NULL if they are equal. Otherwise, the first expression is returned.
NULLIF(expr1, expr2)
Parameter | Description |
---|---|
expr1, expr2 | Required. The two expressions to be compared |
Works in: | From MySQL 4.0 |
---|
Compare two expressions:
SELECT NULLIF(25, "Hello");
Compare two expressions:
SELECT NULLIF("Hello", "world");
Compare two expressions:
SELECT NULLIF("2017-08-25", "2017-08-25");