Easy and fast solution using "except" | Beat 57% of other submissions' runtime.
IntuitionThe essence of the problem is to select those sellers who didn't have any orders related to the company with the name "RED". Therefore, if we choose th
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The essence of the problem is to select those sellers who didn't have any orders related to the company with the name "RED". Therefore, if we choose the names of all

```mssql []
/* Write your T-SQL query statement below */
Select name
FROM SalesPerson

```
Except those who have orders from RED,

```mssql []
Except

Select S.name
FROM SalesPerson AS S
LEFT JOIN Orders as O ON O.sales_id = S.sales_id
LEFT JOIN Company as C ON C.com_id = O.com_id
Where C.name = 'RED'

```
The problem is solved.

# Code
```mssql []
/* Write your T-SQL query statement below */
Select name
FROM SalesPerson

Except

Select S.name
FROM SalesPerson AS S
LEFT JOIN Orders as O ON O.sales_id = S.sales_id
LEFT JOIN Company as C ON C.com_id = O.com_id
Where C.name = 'RED'

```
['MS SQL Server']