A little help here. I really don\'t understand how to use this coalesce in MySQL
I have read all the pages in page 1 result of how to use coalsece
in go
This is a perfect example of the Coalesce
if will change the null
fields/columns to what you want them to be in the case from null
to 0
and 1
.
Copy this into a mysql editor it will look a lot better
Select "Column1 (Dont Want Touched)",
coalesce(column2(That you want set to 0 if null), 0) as column2 /* (give it same name as was e.g. "column2") */,
coalesce(column3(Instead of null set to 1) ,1) as column3 /* (give it same name as was e.g. "column3") */
from "MydataTable"
Where 'somedates' in ('2015-04-10', '2015-04-03', '2015-03-27', '2015-04-17') and id = 10 order by 'somedates';