版权声明: https://blog.csdn.net/Dongguabai/article/details/83615873
in函数需要全表扫描,是很耗性能的。
select name,age,address from USER where name not in (select name from CLASSES);
替换为:
select name,age,address from USER left join CLASSES on USER.name=CLASSES.name where CLASSES.name is null;