实现:查询a中没有关联b的记录
1、select id from a left join b on a.id = b.aid where b.id is null and status = 1
2、select id from a where id not in (select aid from b) and status = 1
那种更好,或者有其他的方式,请大神留下答案
实现:查询a中没有关联b的记录
1、select id from a left join b on a.id = b.aid where b.id is null and status = 1
2、select id from a where id not in (select aid from b) and status = 1
那种更好,或者有其他的方式,请大神留下答案
3 回答3.7k 阅读✓ 已解决
5 回答1.5k 阅读
2 回答2.1k 阅读
3 回答2.1k 阅读
1 回答973 阅读
1 回答641 阅读✓ 已解决
3 回答452 阅读✓ 已解决
not exists正解