求1sql脚本优化方法
求一sql脚本优化方法
------解决思路----------------------
可以考虑给B表增加id的索引
------解决思路----------------------
正解。
select from a where id not in (select distinct id from b)
------解决思路----------------------
select from a where not exists (select 1 from b where id=a.id)
可以考虑给B表增加id的索引
------解决思路----------------------
正解。