Input
Date Points
2012-07-01 5 a@sample.com
2012-07-01 6 b@sample.com
2012-07-01 2 c@sample.com
2012-07-02 5 d@sample.com
2012-07-03 8 e@sample.com
2012-07-03 7
f@sample.com
2012-07-03 1
y@sample.com
2012-07-04 3 x@sample.com
2012-07-04 2 f@sample.com
2012-07-05 3 g@sample.com
2012-07-05 9 b@sample.com
Output
Date Points
2012-07-01 13
2012-07-02 5
2012-07-03 16
2012-07-04 5
2012-07-05 12
Suggest me an MySQL Query for output like the above
解决方案
try
SELECT `date`, SUM(`Points`) AS sumPoint FROM table GROUP BY `date`
Note : dont forget to wrap date column with ` as DATE is reserve keyword of mySQL