I would like to have a MySQL query that given a specified date it will return the last 7 days of results, but in the MySQL table there could be blanks.
So the table could look like this
tblMyData
TestDate | val1 | val2
2014-07-10 | 20 | 30
2014-07-09 | 10 | 10
2014-07-07 | 11 | 22
2014-07-04 | 9 | 45
However my query would need to fill in the blanks so my results would look like this
TestDate | val1 | val2
2014-07-10 | 20 | 30
2014-07-09 | 10 | 10
2014-07-08 | 0 | 0 <<-- Added by the query
2014-07-07 | 11 | 22
2014-07-06 | 0 | 0 <<-- Added by the query
2014-07-05 | 0 | 0 <<-- Added by the query
2014-07-04 | 9 | 45
Any ideas how I can do this?