select *
from Table1
full join Table2 on Table2.Common = Table1.Common
在上面的查詢,我想補充這where
條件:充分參與和where條件
where (Table1.StatusId > 100 or Table1.StatusId is not null)
StatusId
是數據類型numeric(18, 2)
的。
問題是當我使用where
條件時,Table2
中沒有任何連接數據的行在Table1
中不再顯示。
有沒有其他方法可以添加此where
條件?
您正在檢查WHERE子句中的Table1的字段,並且您期望Table1中的那些空值將被顯示?也許你需要條件的第二部分,如:「或Table1.StatusId爲空」 –
其中(Table1.StatusId> 100或Table1.StatusId不爲空)'沒有任何意義。它相當於'where Table1.StatusId不爲空'。 –