Solution with JOIN that beats 91%


  • 0
    G
    DELETE P1.*
    FROM Person AS P1 LEFT JOIN
    (SELECT Min(P.Id) AS Id FROM Person AS P GROUP BY P.Email) AS P2
    ON P1.Id = P2.Id
    WHERE P2.Id Is Null;
    

Log in to reply
 

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