delete from
table_name
where id not in(
select t.minid
from(
select
min(id) as minid
from
table_name
group by
字段名
)t
);
当出现:
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
运行:
SET SQL_SAFE_UPDATES = 1;