List:General Discussion« Previous MessageNext Message »
From:Mauricio Pellegrini Date:August 14 2004 12:29am
Subject:Using SUM in a special way
View as plain text  
Hi,
  I would like to use SUM or any other function to sum a series of
records as in the following example.

I have this table T1

	Col1	Col2 
	1	20
	2	10
	1	10
	2	 5
	1	20
	3	10

and would like to obtain this result from a query

	Col1	Col2	Col3
	1	20	20
	1	10	30
	1	20	50
	2	10	10
	2	 5	15
	3	10	10

Column Col3 should carry forward and sum values from Col2

Is that possible ?, with SQL I mean...


Thank you 
Mauricio



Thread
Using SUM in a special wayMauricio Pellegrini13 Aug
  • Re: Using SUM in a special waySGreen13 Aug
  • Re: Using SUM in a special wayMark Stafford13 Aug
  • Re: Using SUM in a special wayKeith Ivey13 Aug
    • Re: Using SUM in a special wayMauricio Pellegrini13 Aug