nix, shell, perl, php, mysql and mac os x tips and tricks

Tuesday, June 8, 2010

Find duplicate records in MySQL

SELECT email, 
 COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )

No comments:

Post a Comment