我有这样的查询
SELECT DATE(date) AS DateOnly, COUNT(DISTINCT(device_id)) AS nrUnique
FROM `mytable`
WHERE date>='2013-10-04 18:32:04' and date<now()
GROUP BY DateOnly
order by DateOnly
结果
2013-10-05 | 10
2013-10-08 | 5
我想生成像这样的结果
2013-10-04 | 0
2013-10-05 | 10
2013-10-06 | 0
2013-10-07 | 0
2013-10-08 | 5
我在postgresql中使用像这样的联合
这样做....
UNION
(SELECT 0 as count, date(generate_series('2013-10-04 18:32:04'::date, now(),'1 day')) as timestamp))
我如何使用MYSQL做到这一点?