0
我的SQL查詢是這樣的:儘管主記錄爲空,LEFT JOIN應該如何返回值?
SELECT SUM(i.itemPrice) as total, t.sTax
FROM items AS i
LEFT JOIN tax_table AS t ON t.branchID = 10
WHERE i.orderID = 10
當total
不NULL
爲orderID 10
將返回sTax
價值。如果total
是NULL
對於orderID 10
sTax
是NULL
。
如何獲得sTax
雖然如果total
是NULL
?