Possible Duplicate:
MySQL how to fill missing dates in range?
I have a table where one of the columns is a timestamp. I'd like to have a result of a per day hit count (1hit = 1row)
My actual request looks like this:
SELECT
count(id) as count,
date(FROM_UNIXTIME(`time`)) as completedate
FROM `logs`
group by date(FROM_UNIXTIME(`time`))
order by completedate DESC
Limit 0,20
This gives me this result:
count completedate
1 2012-11-13
1 2012-11-12
56 2012-11-11
18 2012-11-09
Now I would like to have the missing:
count completedate
0 2012-11-10
Inside of it, is this possible?