Ana içeriğe atla

Kayıtlar

duplicate records etiketine sahip yayınlar gösteriliyor

Find (Select) / Remove Duplicate Rows From Table

To find the duplicate records , this select query can be used: SELECT column1 , COUNT(*) FROM tableName GROUP BY column1 HAVING COUNT(*) > 1; And to Delete these records, use this: DELETE FROM tableName WHERE id NOT IN (SELECT  MIN(id)                               FROM tableName                               GROUP BY column1, column2, column3...   ) !!! Be careful! It is always good to work with backup. ;)