CREATE TABLE `table` (id int, col int);
INSERT INTO `table` VALUES (1, 100);
INSERT INTO `table` VALUES (2, NULL);
INSERT INTO `table` VALUES (3, 300);
INSERT INTO `table` VALUES (4, NULL);
+------------------+
| COALESCE(col, 0) |
+------------------+
| 100 |
| 0 |
| 300 |
| 0 |
+------------------+
4 rows in set (0.00 sec)