left join turns into inner join

后端 未结 8 796
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 06:24
SELECT
a.foo
b.bar
c.foobar
FROM tableOne AS a
INNER JOIN tableTwo AS b ON a.pk = b.fk
LEFT JOIN tableThree AS c ON b.pk = c.fk
WHERE a.foo = \'something\'
AND c.foo         


        
8条回答
  •  生来不讨喜
    2020-11-29 06:56

    The joins are doing their work, then the where is removing the records where c.foobar <> 'somethingelse'.

    The effect looks like an inner join but actually isn't.

提交回复
热议问题