Open QuXiangjie opened 5 months ago
Question
select distinct P1.email as Email from Person as P1, Person as P2 where P1.email=P2.email group by P1.id having count(P2.email)>=2
High efficient way
SELECT DISTINCT P1.Email FROM Person P1,Person P2 WHERE P1.id <> P2.id AND P1.Email=P2.Email
select distinct P1.email as Email from Person as P1 group by P1.email having count(P1.id)>1
Question
High efficient way