I have a mysql table like this :
date data
01-01-2005 10 |
02-01-2005 11|
03-01-2005 13|
07-01-2005 20|
How i can list like below
date data:
01-01-2005 10|
02-01-2005 11|
03-01-2005 13|
04-01-2005 0|
05-01-2005 0|
06-01-2005 0|
07-01-2005 20|
EDIT: i use a calendar table like this:
date:
01-01-2005 for all 365 days.
this my best opinion but it is not working :
SELECT c.steps, IFNULL(c.steps, 0) value, r.calendar_date
FROM log_activities c
LEFT JOIN calendar r
ON (r.calendar_date = c.date_logged)
WHERE email = 'a@mail.com'
ORDER BY c.date_logged DESC