Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Sum row by row - keep first value to next row and so on

$
0
0

Hi,

This my table

C1 C2
1 2
2 1
3 3
4 4
5 3
6 1
7 6

My expected result is like below table

C1 C2 Sum
1 2 2
2 1 3
3 3 6
4 4 10
5 3 13
6 1 14
7 6 20

Anyone can help me. Thanks in advance.

Regards,

Pratheeskkvi


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>