Why is my left join not returning nulls?

后端 未结 6 1426
半阙折子戏
半阙折子戏 2020-12-05 18:31

In sql server 2008, I have the following query:

select      
    c.title as categorytitle,
    s.title as subcategorytitle,
    i.title as itemtitle
from cat         


        
6条回答
  •  囚心锁ツ
    2020-12-05 18:40

    where (ic.isactive = 1 or ic.isactive is null) and i.siteid = 132
    

    Having the i.siteID = 132 in your where clause essentially nullifies doing a left join on items.

提交回复
热议问题