Skip to content

how to find the duplicate rows in MySQL

Sometimes you must check duplicate row in the database.
Duplicate rows my occur due to race conditions.
I use this solution to find out the duplicate row in my project:

select ColumnA, ColumnB, ColumnC, count(*) as NumDuplicates
from table
group by ColumnA, ColumnB, ColumnC

Link: https://stackoverflow.com/questions/16324328/mysql-select-records-for-duplicates-using-multiple-columns/16324412

If you have a similar experience, please share it with me.

Published inprogramming challenge

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *