If you have a table which has duplicate items in then you can use the below statement to select them.

This comes up a lot during data cleanup — maybe a bulk import created duplicate rows, or a missing unique constraint let bad data slip in. The GROUP BY with HAVING COUNT > 1 pattern is the quickest way to find them.

Once you’ve identified the duplicates, you can decide whether to delete the extras or merge them. If you need to see all the duplicate rows (not just the grouped result), wrap this as a subquery and join it back to the original table. Also worth adding a unique index or constraint after cleanup to prevent the problem from happening again.

There’s a longer note on databases over here.

SELECT * FROM tableName
GROUP BY columnName
HAVING ( COUNT( columnName) >1 )