SQL优化系列——子查询

sql调优方法:

1)not in子查询优化

尽量避免子查询select * from a where id not in(select id from b);

select * from a where not exists(select id from b WHERE id ='100')

建议使用表连接:

select * from a left join b on a.id=b.id WHERE b.id='100'

原文地址:https://www.cnblogs.com/birdstudio/p/6861140.html