SQL / Mysql - How to find and count duplicates
by Andreas Glaser on Oct.22, 2008, under Computer, Development, SQL
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 comments for this entry yet...