May 3, 2008 at 12:27 am
Hi All,
I have a Table with 3 columns
SalesPID SalesAmount DiscountAmount
12 120 20.00
13 130 30.00
14 140 40.00
I Need An Output Table like the Following table which contains extra column with name RunningTotals which is sum of currentRow discountAmount and Previous row of RunningTotal Value.Is it Possible to fill a temporary table or tableVariable or commonTableExpressions or using any other statements without using cursor or looping statements.
SalesPID SalesAmount DiscountAmount Running Totals
12 120 20.00 20.00
13 130 30.00 50.00
14 140 40.00 90.00
Awaiting Your Valuable Inputs
Thanks and Best Regards,
Rajesh
May 3, 2008 at 12:59 am
This is a double post... please post any replies at the following URL...
http://www.sqlservercentral.com/Forums/Topic494354-338-1.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply