有a,b,c三个表(id)取出a和b都有的数据,然后去除c表里面的数据,然后插入d表中
用哪中处理比较快我现在用的方法是先查询出需要的数据,然后插入d表中,查询语句
insert d (id)
(select a.id from a and exists (select 1 from b where b.id=a.id) 
and not exists (select 1 from c where c.id=a.id)
)
或者可以用
insert d (id)
(
select a.id from a 
intersect
select b.id from b
EXCEPT
select c.id from c
)请问下哪个比较快,注意a,b,c表数据都有百万条
或者有更好的办法,谢谢