Select rows with same email
Moderator: General Moderators
Select rows with same email
Hey, I'm looking for a query, with which I would be able to select all rows in a usertable, that have a email that's present 2 or more times in the same usertable. How would I do that?
You group by email, and restrict those groups that exist out of at least 2 items...
Code: Select all
SELECT email, COUNT(*) FROM table GROUP BY email HAVING COUNT(*) >= 2;