Roger Karnouk wrote:
> 
> Is it possible in a Select query to get values from the previously read row
> in order to do things like cumulative sums or other formulas which require
> the previous value in order to calculate the current value.
> 
> ex.
> day     current sales  cumu_total
> -----   -------------------  ----------------
> 1               120              120
> 2           60                 180
> 3          125                305
> 4          40                  345
> 
> I'd like to be able to do this in one select statement
> is this even possible?
> 
> Roger Karnouk
> [EMAIL PROTECTED]
> 


You can totalize all numbers but there isn't really any way in sql
to do cross-row type functions as you indicated?  Why can't you do the
running some in whatever program is generating the output?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to