这样可否:
USE 原表 ALIAS 原表 IN 0
USE 比较后 ALIAS 比较后 IN 0
SELECT * FROM 比较后 WHERE .F. INTO CURSOR tmp_比较后 READWRITE
SELECT 比较后
ZAP
FOR nRecno=1 TO RECCOUNT("原表")
SELECT tmp_比较后
ZAP
SELECT 原表
GO nRecno
SCATTER TO arr_recno
INSERT INTO tmp_比较后 FROM ARRAY arr_recno
GO TOP
SCAN
IF RECNO() != nRecno
SCATTER TO arr_recno
SELECT 列1,列2,列3,列4,列5,列6,列7,列8,列9,列10 FROM tmp_比较后 INTO CURSOR tmp READWRITE
INSERT INTO tmp FROM ARRAY arr_recno
SELECT * FROM tmp INTO ARRAY arr
n = ALEN(arr)
DIMENSION arr[n]
ASORT(arr)
ai = arr[1]
FOR i=2 TO n
IF arr[i]==ai
EXIT
ELSE
ai = arr[i]
ENDIF
ENDFOR
IF i > n
INSERT INTO tmp_比较后 FROM ARRAY arr_recno
REPLACE 循环记录 WITH " 第"+TRANSFORM(RECNO("原表"))+"条" IN "tmp_比较后"
ENDIF
ENDIF
ENDSCAN
GO TOP IN "tmp_比较后"
REPLACE 循环记录 WITH "以第"+TRANSFORM(nRecno)+"为准,有"+TRANSFORM(RECCOUNT("tmp_比较后"))+"条" IN "tmp_比较后"
INSERT INTO 比较后 SELECT * FROM tmp_比较后
ENDFOR
SELECT * FROM 比较后
USE 原表 ALIAS 原表 IN 0
USE 比较后 ALIAS 比较后 IN 0
SELECT * FROM 比较后 WHERE .F. INTO CURSOR tmp_比较后 READWRITE
SELECT 比较后
ZAP
FOR nRecno=1 TO RECCOUNT("原表")
SELECT tmp_比较后
ZAP
SELECT 原表
GO nRecno
SCATTER TO arr_recno
INSERT INTO tmp_比较后 FROM ARRAY arr_recno
GO TOP
SCAN
IF RECNO() != nRecno
SCATTER TO arr_recno
SELECT 列1,列2,列3,列4,列5,列6,列7,列8,列9,列10 FROM tmp_比较后 INTO CURSOR tmp READWRITE
INSERT INTO tmp FROM ARRAY arr_recno
SELECT * FROM tmp INTO ARRAY arr
n = ALEN(arr)
DIMENSION arr[n]
ASORT(arr)
ai = arr[1]
FOR i=2 TO n
IF arr[i]==ai
EXIT
ELSE
ai = arr[i]
ENDIF
ENDFOR
IF i > n
INSERT INTO tmp_比较后 FROM ARRAY arr_recno
REPLACE 循环记录 WITH " 第"+TRANSFORM(RECNO("原表"))+"条" IN "tmp_比较后"
ENDIF
ENDIF
ENDSCAN
GO TOP IN "tmp_比较后"
REPLACE 循环记录 WITH "以第"+TRANSFORM(nRecno)+"为准,有"+TRANSFORM(RECCOUNT("tmp_比较后"))+"条" IN "tmp_比较后"
INSERT INTO 比较后 SELECT * FROM tmp_比较后
ENDFOR
SELECT * FROM 比较后