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.
2.1m questions
2.1m answers
60 comments
57.0k users