Just in case you did not follow this suggestion, if you are using 4.0.x this is
very simple. I was looking for this:

  set @total:=0;
  select f1,f2,...,@total:[EMAIL PROTECTED] as Total from table where ...;

is pretty simple.

On Wed, 25 May 2005, Dan Bolser wrote:

> On Wed, 25 May 2005, Russell Horn wrote:
>
> >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
> >
>
> http://dev.mysql.com/doc/mysql/en/variables.html
>
>
> :D
>
>
>
>
> >Thanks,
> >
> >Russell.
> >
> >
> >
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>

_____
Douglas Denault
http://www.safeport.com
[EMAIL PROTECTED]
Voice: 301-469-8766
  Fax: 301-469-0601

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

Reply via email to