假設這些表:SQL WHERE子句匹配兩個(或更多)加盟行
customer with age column
order with customer_id and item_id column
我需要一個SELECT語句是這樣的:
SELECT ... FROM customer c
JOIN order o ON c.id = o.customer_id
WHERE c.age > 30
AND (c has ordered item_id 1 AND item_id 2)
有一行對每項訂購貨物順序表
請編輯您的問題,並根據該數據添加一些示例數據和預期輸出。 _Formatted_文本,請[無屏幕截圖](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-問題/ 285557#285557) –