Page 1 of 1
Select rows with same email
Posted: Mon Apr 09, 2007 12:18 pm
by Terriator
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?
Posted: Mon Apr 09, 2007 12:34 pm
by Terriator
Mysql should I probably remember to say >_>
Posted: Mon Apr 09, 2007 1:36 pm
by timvw
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;