查询A、B表中,A表中存在B表不存在的数据
1.not in
select distinct A.ID from A where A.ID not in (select ID from B)
2.left join
select A.ID from A left join B on A.ID=B.ID where B.ID is null
3.子查询
select * from a where (select count(1) as num from b where b.ID = a.ID) = 0