Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Wednesday, September 16, 2009

How to find duplicate Rows in SQL

Find the duplicate rows in a mysql table

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