2008
10.22

Some developers facing the problem of duplicates in sql/mysql tables. To find and count them use the following statement.

1
2
3
4
SELECT ID, count(*) as Amount
FROM name_of_the_table
GROUP BY ID
HAVING  Amount > 1

Just replace the used table “name_of_the_table” and the column “ID” which is inspected for duplicates. The output shows you the record which is multiple times in the table and the amount of it.

So long,
Andreas Glaser (aka JaZz)

No Comment.

Add Your Comment
*