I want to group results by day: max value for each of the the last 30 days. I came up with :
select max(value), DATE(time) from table where time>DATE('now', '-30 days') group by DATE(time);
But this on开发者_如何转开发ly gives results for dates with data. I want null or 0 for the dates without data. Is that possible?
精彩评论