要删除重复行,可以使用以下步骤:
SELECT name, age, COUNT(*) FROM table1 GROUP BY name, age HAVING COUNT(*) > 1;
CREATE TABLE temp_table AS SELECT name, age FROM table1 GROUP BY name, age HAVING COUNT(*) > 1;
DELETE table1 FROM table1 INNER JOIN temp_table ON table1.name = temp_table.name AND table1.age = temp_table.age;
DROP TABLE temp_table;
通过执行以上步骤,你可以删除MySQL表中的重复行。请注意,在执行删除操作之前,最好先备份数据以防止意外删除。