2个表结构相同那么取交集是
select * from table1 INTERSECT select * from table2
如何用 INTERSECT 快速删除交集,我想在table1中删除table1和table2的交集。
不用delete from table1 where field* in (select field* from table2)
或者delete from table1 where exist (select * from table2 where field*=table1.field*)之类的需定位到字段匹配的sql。
谢谢!
------解决方案--------------------
sql2008可用Merge
http://blog.csdn.net/roy_88/article/details/6942055
其它版本不用 in和exists
可用
delete a
from table1 as a
inner join
table2 as b on a.[field*]=b.[field*]
------解决方案--------------------
------解决方案--------------------