Reputation: 635
How do I join sums (dollar) from the same date and present them by date in MySQL and PHP?
ID = auto_increment
I wan't the result to be like this
2012-01-14 - 48
2012-02-21 - 19
2012-02-25 - 31
2012-03-01 - 11
Upvotes: 1
Views: 108
Reputation: 163430
SELECT `DATE`, SUM(`DOLLAR`) FROM your_table GROUP BY `DATE`;
http://www.tizag.com/mysqlTutorial/mysqlgroupby.php
Upvotes: 2