accepted solution using joins only


  • 0
    S

    I would like to know better ways to write it, feel free to comment. Thanks a lot!

    select ss.name 
    from (
    select distinct sales_id
    from orders oo
    left join company cc on oo.com_id = cc.com_id
    where cc.name = 'RED' ) red
    right join 
    salesperson ss on red.sales_id = ss.sales_id
    
    where red.sales_id is null 
    

Log in to reply
 

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