in exists from join子查询速度对比分析
场景不同速度不同没有谁比谁快
场景1:查询大学学生(大一,大二,大三,大四)
student:
id ,name, classid
class:
id,name,parentid
语句一:select id,name from student where classid in (1,2,3,4);
语句二:select id,name from student where classid in (select id from class where parentid = 3
语句三:select id,name from student inner join (select id from class where parentid=3) as tmp on student.classid=tmp.id;
未经允许不得转载:开心乐窝-乐在其中 » in exists from join 子查询速度对比分析