我有兩個表,我需要使用where子句。 表1SQL其中空值
CustomerID Product
1 Car
2 Table
3 Golf
4 Foo
5 Yoo
表2
CustomeID Comment
2 Three items
3 Returned
4 Complaint
我有兩個過濾器在where語句這樣
Select * from table1 a left
join table2 b on a.customerid= b.customerid
where b.comment<>'Returned' and b.comment not like 'Three%'
當我運行查詢我剛剛得到一個記錄的查詢。我希望它也返回兩個的customerID的哪些不是在表2(三條記錄)
所以你試圖根據'WHERE'條件過濾掉,但你也想要返回你正在過濾掉的那些?您的預期輸出將以表格形式顯示? –