Accepted solution using NOT EXISTS


  • 0
    SELECT  s.name
    FROM    salesperson s
    WHERE   NOT EXISTS (
        SELECT  s.name
        FROM    company c, orders o
        WHERE   s.sales_id = o.sales_id 
            AND c.com_id = o.com_id
            AND c.name = 'RED'
        );
    

Log in to reply
 

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