逻辑复杂(其实也不复杂),但是速度快: select * from B where (select count(1) from A where A.ID = B.ID) = 0; 速度快的原因是,使用了索引。