连前统计问题
有表A:
A B
100 1
101 2
102 3
104 1
105 1
要求得出:
A B C
100 1 1
101 2 3
102 3 6
104 1 7
105 1 8
[解决办法]
VFP9:
SELECT *,(SELECT SUM(B) FROM TT WHERE A.A> =A) AS C FROM TT A