Find duplicate records in MySQL

In this post, I demonstrate different way to find duplicate records in MySQL.
I have found some alternative solution to find duplicate records in MySQL.
As per your data size you can choose any one of this solution.

Let’s first create sample duplicate data:

First solution using Self Join:

Second solution using SUB Queries:

Third solution using Table Aliases:

Fourth solution using Group BY:

This all are different solution to find duplicate records in MySQL.
As you can choose any one of this but my suggestion is to use first solution which will perform faster.

Anvesh Patel

Leave a Reply

1 Comment on "Find duplicate records in MySQL"

Notify of
avatar
Sort by:   newest | oldest | most voted
Rajiv
Guest

Nice post !
This worked for me.

wpDiscuz