--假设ID为关键字 select * from A where id not in (select id from B)--如果有两(多)个关键字id1,id2 select * from A where not exists(select 1 from B where id1 = A.id1 and id2 = A.id2)
select * from test1 where id not in (select id form test2) select a.* from test1 a,test2 b where a.id!=b.id 个人感觉第一个好
select * from A where id not in (select id from B)--如果有两(多)个关键字id1,id2
select * from A where not exists(select 1 from B where id1 = A.id1 and id2 = A.id2)
select a.* from test1 a,test2 b where a.id!=b.id
个人感觉第一个好