I am getting NULL values in the results of an operation in MySQL.
NULL
Is there a way to convert the NULL values into the value 0?
Yes, by using COALESCE.
COALESCE
SELECT COALESCE(null_column, 0) AS null_column FROM whatever;
COALESCE goes through the list of values you give it, and returns the first non-null value.
1.4m articles
1.4m replys
5 comments
57.0k users