Let's say I have a this search query like this:
SELECT COUNT(id), date(created_at)
FROM entries
WHERE date(created_at) >= date(current_date - interval '1 week')
GROUP BY date(created_at)
As you know then for example I get a result back like this:
count | date
2 | 15.01.2014
1 | 13.01.2014
9 | 09.01.2014
But I do not get the days of the week where no entries where created.
How can I get a search result that looks like this, including the days where no entries where created?
count | date
2 | 15.01.2014
0 | 14.01.2014
1 | 13.01.2014
0 | 12.01.2014
0 | 11.01.2014
0 | 10.01.2014
9 | 09.01.2014