Here’s query for finding duplicates in a table. Suppose you want to find all Usernames values in a table that exist more than once:
[sql]
SELECT Username, COUNT(Username) AS NumOccurrences
FROM Users
GROUP BY Username
HAVING (COUNT(Username) > 1)
[/sql]
Home