Say I track a bunch of sales everyday by individual transaction, i.e. Each transaction take a row in my sales table. I use count(*) and group by date to generate a results such as
1 Jan - 3
2 Jan - 2
3 Jan - 8
...
But the problem is, if there is 0 sales in a day, the date won't appear and my result will 'skip' that day
1 Jan - 3
2 Jan - 2
3 Jan - 8
5 Jan - 2
** 4 Jan missing if no individual sale tracked on that day.
How to I make MySQL return this instead?
1 Jan - 3
2 Jan - 2
3 Jan - 8
4 Jan - 0
5 Jan - 2
Any idea? Thank You.