俺是菜鸟
A表存在一个id字段,B表也存在一个id字段
需要将A表中不存在,B表中存在的记录全部过滤出来
(1) select * from t_website_notemp where id not in(select id from t_website);
(2) select t_website_notemp.* from t_website_notemp left join t_website on t_website_notemp.id = t_website.id where t_website.id is NULL;
(3) select * from t_website_notemp id where not exists (select id from t_website);
至于具体的性能,也不能就说谁就是绝对的高,应该和数据表的大小等有关,不研究了