Skip to content
Home » News » Find Duplicate Rows Query

Find Duplicate Rows Query

Here’s an SQL query that’ll return all the duplicate rows in your table.

SELECT `id`, COUNT(*) as `dup`
FROM `table_name`
GROUP BY `id`
HAVING `dup` > 1
ORDER BY `dup`