Find Duplicate Entries
Posted: Mon Sep 18, 2006 8:40 am
Is there any SQL command I can run to search a MySQL DB and find any duplicate entries and then print out which ones are duplicate?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
SELECT a.* FROM articles as a, articles as a2 where a.title = a2.title and a.body = a2.body and a.id <> a2.idCode: Select all
select uniqueCol, count(*) as count from tbl_name group by uniqueCol having count >= 2Code: Select all
select uniqueCol0, uniqueCol1, uniqueCol2, count(*) as count from tbl_name group by uniqueCol, uniqueCol, uniqueCol having count >= 2