Simple solution no subquery


  • 0
    C
    select S.name
    from company C
    left join orders O
    on C.com_id = O.com_id
    right join salesperson S
    on S.sales_id = O.sales_id
    group by S.name
    having sum(if(C.name = 'RED',1,0)) =0
    

Log in to reply
 

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