Pages

Sunday, May 4, 2008

Check for duplicate records

One of the very basic and common that i have seen in my mail box and in forums is what is the easiest way to find out duplicate records.

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

No comments: