Simple solution using LEFT JOIN


  • 0
    SELECT c1.name
    FROM customer c1 
    LEFT JOIN customer c2
    ON c1.id = c2.referee_id
    WHERE c2.name <> 'Jane'

Log in to reply
 

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