好奇葩的问题(leftjoin)
[解决办法]
嗯,对的,left join的就放on后面
[解决办法]
on后面是关联条件,where的才是筛选条件
[解决办法]
你where的时候筛选掉了
[解决办法]
是被左联的表,的条件写在on 后面,比如:
select *
from a
left join b
on a.id = b.id and b.xxx = xxx
where a.xxx = xxx
对b的过滤条件可以写在on后面,而a表的过滤条件,可以写在on后面,也可以写在where 后面
[解决办法]
on 是连接条件 ;where 是过滤条件。