楼主能告诉我,表中数据的意思吗
该问题的网址?
CLEAR CREATE CURSOR T (K C(1),S C(1)) CSTR=[1,1;2,1;1,2;2,2;1,4;2,5;3,1;3,2;1,5] FOR I=1 TO ALINE(AA,CSTR,[;]) =ALINE(BB,AA(I),[,]) INSERT INTO T VALUES (BB(1),BB(2)) ENDFOR SELECT K,CAST(MIN(S) AS N(1)) M1,CAST(MAX(S) AS N(1)) M2,COUNT(S) CN FROM T GROUP BY 1 INTO CURSOR T1 ?[查询结果:] SCAN CREATE CURSOR TT (S C(1)) FOR I=T1.M1 TO T1.M2 INSERT INTO TT VALUES (TRANSFORM(I)) ENDFOR SELECT TRANSFORM(RECNO([T1])) R,NVL(T.K,[]) K,TT.S S FROM T FULL JOIN TT ON T.S==TT.S AND T.K==TRANSFORM(RECNO([T1])) INTO CURSOR T2 SELECT T2 SCAN FOR EMPTY(K) ? R,S &&丢失的流水号 ENDSCAN SELECT T1 ENDSCAN献丑了
CREATE CURSOR TTT (K C(1),S C(1)) &&保存丢失的流水号 CREATE CURSOR T (K C(1),S C(1)) CSTR=[1,1;2,1;1,2;2,2;1,4;2,5;3,1;3,2;1,5] FOR I=1 TO ALINE(AA,CSTR,[;]) =ALINE(BB,AA(I),[,]) INSERT INTO T VALUES (BB(1),BB(2)) ENDFOR SELECT K,CAST(MIN(S) AS N(1)) M1,CAST(MAX(S) AS N(1)) M2,COUNT(S) CN FROM T GROUP BY 1 INTO CURSOR T1 SCAN CREATE CURSOR TT (S C(1)) FOR I=T1.M1 TO T1.M2 INSERT INTO TT VALUES (TRANSFORM(I)) ENDFOR SELECT TRANSFORM(RECNO([T1])) R,NVL(T.K,[]) K,TT.S S FROM T FULL JOIN TT ON T.S==TT.S AND T.K==TRANSFORM(RECNO([T1])) INTO CURSOR T2 INSERT INTO TTT SELECT R,S FROM T2 WHERE EMPTY(K) SELECT T1 ENDSCAN SELECT TTT BROWSE