Click here to see the full article post
@lightning_mi For this particular problem, you can use inner join if this is what you are asking. The solution is trying to focus on looking through ALL of the orders.
from what I understood about the problem was that, it is asking for all the salespeople who didn't have a business deal with some company, a company can have many sales people who did not make a deal at all, so they do not figure in the orders table. hence the left outer join on the salesperson tables is required.
I wrote my code below, not sure why it is wrong. Anyone know the reason? Thanks a lot for the help.
select distinct s.name
from salesperson s
left join orders o
where o.sales_id not in (
select sales_id from orders where com_id=1
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.