I have a pretty simple table with a list of payments, not much more
than:

paymentID | amount | paymentDate
1         | 123    | 2005-01-10
2         | 77     | 2005-01-13
3         | 45     | 2005-02-16
4         | 13     | 2005-02-17


I can get totals per month using a query like:

SELECT SUM(amount) , DATE_FORMAT( `paymentDate` , '%Y-%m' )   FROM
`payments`   GROUP BY DATE_FORMAT( payments . date , '%Y-%m' ) 

That would give me:

amount | paymentDate
200    | 2005-01
58     | 2005-02

Is there any way to get a running cumulative total directly from mysql?
Something like:

amount | paymentDate
200    | 2005-01
258    | 2005-02

Thanks,

Russell.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to