what is the query to delete the duplicate records from Table
Posted: Mon Jan 02, 2006 10:57 pm
what is the query to delete the duplicate records from Table ?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
DELETE FROM table
WHERE tableid IN (
SELECT tableid
FROM table
GROUP BY (attribute1, attribute2, ...)
HAVING COUNT(*) > 1
)Code: Select all
select count(*) as count, `record` from `table`group by `record`