Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,
please find the below sql server table table .

COL A	Col B
1	1000
2	2000
3	1000
4	2000
5	3000


i want out put like below . it means colb1,colb1+colb2,col1+col2+col3 etc.
COL A	Col B
1	1000
2	3000
3	4000
4	6000
5	9000
Posted
Updated 14-Mar-15 3:16am
v3
Comments
[no name] 14-Mar-15 7:38am    
What you have tried? so far

You don't want to - because next time to try you will update row 2 to 4000, row 3 to 7000, and so on.
Instead, return a running total column based on a query: Calculating simple running totals in SQL Server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900