题目:
表记录行累加,给上一条记录。比如说一个表中有两列:
BZ LDATA
----------------------
A 100
B 200
C 300
D 400
整理后变为:
BZ SLDATA
----------------------
A 1000
B 900
C 700
D 400
实现思路:By 【秦皇岛-sunny(43569137) 】
=================================================
Create Table ttt (c1 Number(4));
insert into TTT (C1) values (100);
insert into TTT (C1) values (300);
insert into TTT (C1) values (322);
insert into TTT (C1) values (200);
insert into TTT (C1) values (400);
commit;
Select b.c1,Sum(a.c1)
From ttt a,ttt b
Where b.c1 <= a.c1
Group By b.c1 ;
阅读(842) | 评论(0) | 转发(0) |