How do I find duplicate records?

12 views
Skip to first unread message

Support

unread,
May 7, 2020, 1:12:28 PM5/7/20
to ParaSQL Support
I need to find duplicate records in a table. How can I do that?

Support

unread,
May 7, 2020, 1:16:59 PM5/7/20
to ParaSQL Support
You would use a query like this to find duplicates of 2 columns:

SELECT col1, col2, COUNT(*) as `Duplicate_Count`, GROUP_CONCAT(PrimaryKeyCol) as `IDs`
FROM table_name
GROUP BY col1, col2
HAVING COUNT(*) > 1

This would give you a list of duplicates, the number of duplicates, and the IDs of the duplicate records.

Support

unread,
May 7, 2020, 1:19:28 PM5/7/20
to ParaSQL Support
Extra key words below to make finding this post easier:
finding duplicates
deduplication
SELECT INTO errors


Reply all
Reply to author
Forward
0 new messages