MySQL数据去重

删除掉某表重名用户

表名: user
字段:
主键: id
用户名: name

1
delete from user where id not in(SELECT max(id) from user group by name);