0
如果條件LEFT JOIN爲false,如何讓它爲空而不是跳過它? 這部分代碼:如果條件LEFT JOIN爲false,如何讓它爲空而不是跳過它?
SELECT
c.Name,
p.Name
FROM Category c
LEFT JOIN ProductCategory pc ON c.CategoryID = pc.CategoryID
LEFT JOIN Product p ON pc.ProductID = p.ProductID
WHERE pc.ProductID = 17;
結果必然是:
FirstCategory SeventeenProduct
SecondCategory SeventeenProduct
ThirdCategory null
FourthCategory SeventeenProduct
等等