mysql> SELECT IFNULL(0, 123);
+----------------+
| IFNULL(0, 123) |
+----------------+
| 0 |
+----------------+
1 row in set (0.00 sec)
mysql> SELECT IFNULL(1, 123);
+----------------+
| IFNULL(1, 123) |
+----------------+
| 1 |
+----------------+
1 row in set (0.00 sec)
mysql> SELECT IFNULL(NULL, 123);
+-------------------+
| IFNULL(NULL, 123) |
+-------------------+
| 123 |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT COALESCE(0, 123);
+------------------+
| COALESCE(0, 123) |
+------------------+
| 0 |
+------------------+
1 row in set (0.00 sec)
mysql> SELECT COALESCE(1, 123);
+------------------+
| COALESCE(1, 123) |
+------------------+
| 1 |
+------------------+
1 row in set (0.00 sec)
mysql> SELECT COALESCE(NULL, 123);
+---------------------+
| COALESCE(NULL, 123) |
+---------------------+
| 123 |
+---------------------+
1 row in set (0.00 sec)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>