Simple Solution: Left Join and in subquery beats 92%

  • 0

    select distinct name from
    salesperson where name not in
    (select distinct from
    (select o.com_id,
    from salesperson s
    left join
    orders o
    on s.sales_id = o.sales_id)k
    where k.com_id in(select distinct com_id from company where name='RED'))

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.