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

Tuesday, June 8, 2010

Find duplicate records in MySQL

1.SELECT email,
2. COUNT(email) AS NumOccurrences
3.FROM users
4.GROUP BY email
5.HAVING ( COUNT(email) > 1 )

No comments:

Post a Comment