we have a table id and name
id value
1 (10)
2 (20),
3 (30),
4 (40),
5 (50);
6 (60);
write a query for this outputid value1 (10)2 (30),3 (60),4 (100),5 (150);6 (210);
select t1.value, (select sum(t2.value) from tblname t2 where t2.value<=t1.value)as new from tblname t1
0 comments:
Post a Comment