核心思想 通过左链接 查询出要排除的数据
然后和主表进行匹配 拿去未匹配到的数据 可以使用 IS NULL 来过滤掉
案例稍后 更新
select * from a left join on a.id = b.a_id where b.id is NULL;
核心思想 通过左链接 查询出要排除的数据
然后和主表进行匹配 拿去未匹配到的数据 可以使用 IS NULL 来过滤掉
案例稍后 更新
select * from a left join on a.id = b.a_id where b.id is NULL;
转载于:https://www.cnblogs.com/y734290209/p/9238528.html