实现根据相同的用户名称进行删除保留最小id序列
解决 You can't specify target table '表名' for update in FROM clause错误
查出所有用户名相同的条目并排除id最小的
id序号
name 用户名
delete from t_user_copy_copy1
where `name` in (SELECT t1.`name` FROM (select `name`,id from t_user_copy_copy1 group by `name` having count(`name`) > 1) t1)
and id not in (SELECT t2.id FROM (select min(id) as id from t_user_copy_copy1 group by `name` having count(`name`)>1) t2)