How To Delete Duplicate Rows In Mysql

1 min read

A) Delete duplicate rows using DELETE JOIN statement

MySQL provides you with the DELETE JOIN statement that allows you to remove duplicate rows quickly.

The following statement deletes duplicate rows and keeps the highest id:

SELECT * FROM products mto WHERE EXISTS ( SELECT 1 FROM products mti WHERE mti.name = mto.name ORDER BY `mto`.`name` ASC LIMIT 1, 1 ) ORDER BY `thumbnail_img` ASC

 

Total Execution Time content: 0.00045604705810547 Mins Total Execution Time social : 0.0001 Mins

Read Next

Total Execution Time red next: 0.0000 Mins

Search Now






Categories