Possible Duplicate:
What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)?
Create Table:
CREATE TABLE `trb3` (
`value` varchar(50) default NULL,
`date` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT date, SUM(value) AS value FROM trb3 GROUP BY date ORDER BY date DESC
but
Jun 30 2011,100
Jun 29 2011,90
.
.
Jun 10 2011,90
Jun 02 2011,89
Jun 01 2011,10
Why Jun 03 data is not appear?
How to solve this problem.
You’ll need to get a list of the dates you want then outer join with it:
then populate my_dates with the dates you want data for:
then
EDIT:
FYI, this is not intended to be a temporary table, it’s a permanent table.