MYSQL语句 注意写法
3个表都非常大时,原因待查
1.超级耗时(几分钟)
select * from ywlr
left join sys_user suser on suser.dept_id=ywlr.studentid and suser.user_type in(6,8)
left join xxpt_student st on ywlr.studentid=st.id
where st.school_id=1234
2.很快(几毫秒)
select * from ywlr
left join sys_user suser on suser.dept_id=ywlr.studentid
left join xxpt_student st on ywlr.studentid=st.id
where st.school_id=1234 and suser.user_type in(6,8)