有两个表tb1和tb2结构一样,想把表tb2中身份证号sfzh不在tb1里的数据追加到tb1中,下面的循环哪里错了?
USE tb2
SCAN INSERT INTO tb1 SELECT tb2.xm,tb2.sfzh FROM tb1 WHERE tb2.sfzh NOT in (sele sfzhFROM tb1)
ENDSCAN
SELECT tb1
请高手出手,多谢了!
INSERT INTO tb1 SELECT tb2.xm,tb2.sfzh FROM tb1 WHERE tb2.sfzh NOT in (sele sfzhFROM tb1)
改为
INSERT INTO tb1 (xm,sfzh) SELECT tb2.xm,tb2.sfzh FROM tb2 WHERE tb2.sfzh NOT in (sele sfzhFROM tb1)