问个sql查询问题。inner join on条件和where条件的效率
如:select xxjj.*,bjsj.bj
from wx_xx_xxjj xxjj
INNER JOIN wx_xx_bjsj bjsj on xxjj.campusid=bjsj.campusid and bjsj.orgcode=10008
where xxjj.type=6 and xxjj.title like concat('%',bjsj.bj,'%') and xxjj.orgcode=10008;
和
select *
from wx_xx_xxjj xxjj
INNER JOIN wx_xx_bjsj bjsj on xxjj.campusid=bjsj.campusid
where xxjj.type=6 and xxjj.title like concat('%',bjsj.bj,'%') and bjsj.orgcode=10008 and xxjj.orgocde=10008;
两个sql结果一样。
就是 过滤条件 加在 INNER JOIN 表 ON 条件 AND 条件 ; 和加在where后面的效率区别。 INNER JOIN 表 ON 条件 WHERE 条件