delete from think_user where id in (select id from (select max(id) as id,count(username) as count from think_user group by username having count >1 order by count desc) as tab )
其中think_user为表名,username为其中一个字段
网上找了很多方法,测试结果只有这好用,不知道是不是数据库版本问题。
2009-2017 © diubo.com