607. Sales Person
(資訊來自於leetcode 607
Sales Person)
銷售人員
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
order_id 是該表的主鍵列。
com_id 是 Company 表中 com_id 的外鍵。
sales_id 是 SalesPerson 表中 sales_id 的外鍵。
此表的每一行都包含有關一個訂單的信息。 這包括公司的 ID、銷售人員的 ID、訂單的日期和支付的金額。
編寫一個 SQL 查詢來報告所有沒有與名稱為“RED”的公司相關的訂單的銷售人員的姓名。
以任意順序返回結果表。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
解題方式:
解題解析:
我們可以先利用題目給我們的條件,把三個TABLE都JOIN起來,JOIN起來後我們可以找出訂貨公司有"RED"的銷售員,再用WHERE找出沒有與"RED"公司交易的銷貨員