To convert a null value to zero returned by a mysql query use the function COALESCE(value,…)
Mysql Query :
SELECT COALESCE(column_that_might_be_null,0) as column_with_null_converted_to_zero FROM table_with_column_that_might_be_null;
To convert a null value to zero returned by a mysql query use the function COALESCE(value,…)
Mysql Query :
SELECT COALESCE(column_that_might_be_null,0) as column_with_null_converted_to_zero FROM table_with_column_that_might_be_null;
We at kodeplay like to share knowledge. With Kodetricks, even you can join us. All you need to do is post a programming related trick if you have one or rate a trick if you like someone else's.