Delete Duplicate Records in MySql

Remove more than one duplicate customer information in Customer Table

Case :

DELETE FROM <

> WHERE < NOT IN (SELECT * FROM (SELECT MAX(n.<>) FROM <> n GROUP BY n.<>) x)

Example :-

DELETE FROM customer
WHERE id NOT IN (SELECT *
FROM (SELECT MAX(n.id)
FROM custiomer n
GROUP BY n.customer_name) x)

Advertisements