Click here to see the full article post
Write your MySQL query statement below
SELECT Email FROM Person
GROUP BY Email
This works, but can I understand that * as Email only? If yes, is it because it's the only element in SELECT, or is it because it's the only element in GROUP BY?
group by with having a clause.
select Email from person group by Email having count(Email) >1
A simple SELF JOIN is enough:
SELECT DISTINCT p1.Email FROM Person p1, Person p2 WHERE p1.Email = p2.Email and p1.id != p2.id ;
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.