标签:user char .com img receiver info bubuko charge sele
有两个表
这是ucbi表
这是cai表
SELECT
ucbi.Userid,
ucbi.Carid,
ucbi.rechargetime,
ucbi.Datetime
FROM
usercaridbindinfo ucbi
LEFT JOIN carauthinfo cai ON cai.Receiver = ‘15801377365‘
应该会产生如下的中间表
WHERE
ucbi.Userid = ‘15801377365‘ or ucbi.Userid = cai.Userid;
出现了重复 是不是可以想成where 循环,
ucbi.Userid = ‘15801377365‘ or ucbi.Userid = cai.Userid;
拆分开 ucbi.Userid = cai.Userid; 有两条符合 13311069699 和 13311069600
ucbi.Userid = ‘15801377365‘ or ucbi.Userid = 13311069699 ;
ucbi.Userid = ‘15801377365‘ or ucbi.Userid = 13311069600 ;
where 一共是两次循环,
第一次过滤 ucbi.Userid = ‘15801377365‘ or ucbi.Userid = 13311069699 ;
第二次过滤ucbi.Userid = ‘15801377365‘ or ucbi.Userid = 13311069600 ;
于是出现了重复.
标签:user char .com img receiver info bubuko charge sele
原文地址:https://www.cnblogs.com/zuochanzi/p/10224345.html