Are you want to delete duplicate rows from MySQL table? Using one MySQL query, you can remove duplicate records from table. MySQL query for remove duplicate rows from the database table is given below.
The following query deletes all duplicate rows from the table and keeps the highest ID.
DELETE t1 FROM `users` t1, `users` t2 WHERE t1.id < t2.id AND t1.name = t2.name
The following query deletes all duplicate rows from the table and keeps the lowest ID.
DELETE t1 FROM `users` t1, `users` t2 WHERE t1.id > t2.id AND t1.name = t2.name