NULLIF(expr1,expr2) : NULLIF : Control Flow Functions MySQL TUTORIALS


MySQL TUTORIALS » Control Flow Functions » NULLIF »

 

NULLIF(expr1,expr2)


Returns NULL if expr1 = expr2 is true, otherwise returns expr1.

mysql>
mysql> SELECT NULLIF(1,1);
+-------------+
| NULLIF(1,1|
+-------------+
|        NULL |
+-------------+
row in set (0.00 sec)

mysql> SELECT NULLIF(NULL,2);
+----------------+
| NULLIF(NULL,2|
+----------------+
| NULL           |
+----------------+
row in set (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Control Flow Functions
» NULLIF