方法一(效率底)
select distinct A.ID from A where A.ID not in (select ID from B)
方法二(效率中)
select A.ID from A left join B on A.ID=B.ID where B.ID is null
方法三(效率高)
select * from B where (select count(1) as num from A where A.ID = B.ID) = 0
转自:https://www.cnblogs.com/jameshappy/p/6038706.html