CLEAR
CREATE CURSOR CurTable(ID N,F1 C(1),F2 C(1),F3 C(1),F4 C(1),F5 C(1),F6 C(1))
INSERT INTO CurTable(id,F1,F2,F3,F4,F5,F6) VALUES (1,'A','B','C','D','E','F')
INSERT INTO CurTable(id,F1,F2,F3,F4,F5,F6) VALUES (2,'G','C','F','A','I','H')
INSERT INTO CurTable(id,F1,F2,F3,F4,F5,F6) VALUES (3,'Y','M','O','U','T','L')
INSERT INTO CurTable(id,F1,F2,F3,F4,F5,F6) VALUES (4,'F','C','U','L','W','X')
SELECT LEN(CHRTRAN(A.F1+A.F2+A.F3+A.F4+A.F5+A.F6,CHRTRAN(A.F1+A.F2+A.F3+A.F4+A.F5+A.F6,B.F1+B.F2+B.F3+B.F4+B.F5+B.F6,''),'')) AS 个数 FROM CurTable a INNER JOIN CurTable b ON a.id=b.id-1
笑而不语~
在没有id字段的情况下,先用recno()产生一个id作为上下记录比较依据.