select * from table1 where not 关健字段 in (select 关键字段 from table2);
into table table3
假设重复的字段为Name,Address
select identity(int,1,1) as autoID, * into #Tmp from table3
select min(autoID) as autoID into #Tmp2 from #Tmp group by Name,autoID
select * from #Tmp where autoID in(select autoID from #tmp2)
最后一个select即得到了Name,Address不重复的结果集(但多了一个autoID字段,实际写时可以写在select子句中省去此列)
要有个关键字段进行索引
用索引来判断是否存在就会很快。
或用
select * from table1 where not 关健字段 in (select 关键字段 from table2) into table table3
into背后可能写错了,vfp中的sql不太熟悉
供参考
-------------------------
我流落在凄凉的世界里-孤苦伶仃
我过着动荡无助的生活-四处漂泊