select * from A where not exists ( select * from B where A.id = B.id )和select * from A where A.id not in ( select * from B)