sql语句and条件生效问题

left join a left join b left join c,现在想加个and条件,and a.name=张三,and b.id=5。sql应该怎么写and条件才会生效?我直接在后面写and条件不生效


你要加公共列  left join a left join b left join c on a.id=c.id where  id='5' and a.name=张三

加在where 后边就是对最终结果筛选,加载 join on 后边的and就只会影响左边或者右边的数据,

img

可以参考下这个http://t.csdn.cn/P8ODz