SQL左右连接中的on and和on where的区别
时间:2021-07-01 10:21:17
帮助过:10人阅读
* FROM `
user` us
LEFT JOIN department de
ON us.depart_id
=de.id
and us.depart_id
=‘6‘(on and 符合左边表所有条件,and后面无作用)
SELECT * FROM `
user` us
LEFT JOIN department de
ON us.depart_id
=de.id
where us.depart_id
=‘6‘(on where 对全部表有限制)
简单一句话:on and:符合左表所有条件,on where:对全部表有限制
SQL左右连接中的on and和on where的区别
标签:限制 的区别 use 左连接 rom art join bsp span