如何查找两个表里,相同的字段,不同的数据
又得请教各位高手了。我有两个表格,字段都一样,但是有朋友给我搞恶作剧,把一些字段里的数据给我改变了,我能用个什么命令查找出来吗
论坛上传附件经常失败。我只能传到百度网盘,希望您从百度网盘下载
http://pan.baidu.com/share/link?shareid=479886&uk=4077588256
[ 本帖最后由 chuxue 于 2013-5-29 10:13 编辑 ]
SELECT RECNO() 序号,* FROM A2 INTO CURSOR A22 SELECT RECNO() 序号,* FROM A1 INTO CURSOR A11 EE=AFIELDS(AA,'A11') CREATE CURSOR T (序号 C(12),准考证号 C(12),字段名 C(10),A1内容 C(20),A2内容 C(20)) &&保存不同记录的临时表 FOR I=1 TO EE STORE "SELECT " TO ASQLA,ASQLB IF UPPER(AA(I,1))<>'序号' ASQLA=ASQLA+"'"+AA(I,1)+"' AS ZD,序号,准考证号 ZKZH,"+AA(I,1)+" FROM A11 INTO CURSOR QTA" &ASQLA ASQLB=ASQLB+"'"+AA(I,1)+"' AS ZD,序号,"+AA(I,1)+" FROM A22 INTO CURSOR QTB" &ASQLB ASQLC="INSERT INTO T SELECT A.序号,A.ZKZH,A.ZD,A."+AA(I,1)+",B."+AA(I,1)+" FROM QTA A LEFT JOIN QTB B ON A.序号=B.序号 WHERE A."+AA(I,1)+"<>B."+AA(I,1) &ASQLC ENDIF NEXT SELECT T INDEX ON 序号 TO XH BROWSE