我有mysql查询
SELECT date, COALESCE(SUM(events),0) AS hotel_c
FROM event_cohort_report
WHERE date >= '2015-08-05' AND campaign='Pointific_Incent' AND country='IN'
GROUP BY date
当我运行此查询时,我得到了这个结果
date hotel_c
2015-08-07 5411
2015-08-08 4602
2015-08-09 5151
2015-08-10 183
2015-08-11 1
但是如果表格中没有这样的话,我希望所有的日期和为零。
date hotel_c
2015-08-05 0
2015-08-06 0
2015-08-07 5411
2015-08-08 4602
2015-08-09 5151
2015-08-10 183
2015-08-11 1