sql replace null with 0 code example
Example: replace null with 0 in sql
SELECT IFNULL(Price, 0) FROM Products;
SELECT COALESCE(Price, 0) FROM Products;
-- Oracle (extra):
SELECT NVL(Price, 0) FROM Products;
SELECT IFNULL(Price, 0) FROM Products;
SELECT COALESCE(Price, 0) FROM Products;
-- Oracle (extra):
SELECT NVL(Price, 0) FROM Products;