I have a table like below :
ID | VALUE |
---|---|
1 | 200 |
2 | 300 |
3 | 100 |
4 | 50 |
5 | 1000 |
6 | 20 |
I want a row level sum for each row. Like for ID 1,it should be the sum of VALUEs from ID 1 to 6 , for ID 2 it should be 2 to 6 and like this .
My desired output should look like this :
ID | VALUE | AGG_VAL |
---|---|---|
1 | 200 | 1670 |
2 | 300 | 1470 |
3 | 100 | 1170 |
4 | 50 | 1070 |
5 | 1000 | 1020 |
6 | 20 | 20 |