SQL 的 AND 问题
我很好奇 AND 前半段参数不对 后半段 还走吗?
比如 select * from a where 1=2 and 1=1 , 在 1=2的时候 已经取不到值的时候, 还会走1=1吗?
或者说
select * from ShopSpec a
left join ShopImg b on a.SpecNo=b.ShopNo and b.ImgNo is not null
和
select * from ShopSpec a
left join ShopImg b on b.ImgNo is not null and a.SpecNo=b.ShopNo 一样吗?
如果前面为假 后面不走 , 在关联的时候, 把B表的条件写前面, 关联写后面 是不是会省点时间。 因为B表图片为空就算关联上了也没用。