Mega Code Archive

 
Categories / MySQL Tutorial / Control Flow Functions
 

IFNULL() with NULL and NOT NULL value

mysql> mysql> SELECT IFNULL(NULL,'The value is Null'); +----------------------------------+ | IFNULL(NULL,'The value is Null') | +----------------------------------+ | The value is Null                | +----------------------------------+ 1 row in set (0.00 sec) mysql> mysql> SELECT IFNULL(10,'The value is Null'); +--------------------------------+ | IFNULL(10,'The value is Null') | +--------------------------------+ | 10                             | +--------------------------------+ 1 row in set (0.00 sec) mysql>