Table have data like
<--------------------------->
no category value
<--------------------------->
1 1 2000
2 1 1000
3 2 500
4 3 3000
5 1 2000
6 2 -500
7 3 5000
8 1 -1000
And i want output like
<---------------------------------->
no category amount Sum
<---------------------------------->
1 1 2000 2000
2 1 1000 3000
3 2 500 500
4 3 3000 3000
5 1 2000 5000
6 2 -500 0
7 3 5000 8000
8 1 -1000 4000
for eg: take category=1
so,
no:1
amount=2000--->total=2000
no:2
amount=1000---->total=3000
no:5
amount=2000---->total=5000
no:8
amount=-1000---->total=4000
that means sum of each category on every row and with better performance