结果

然后就可以用php或其他语言来删除这些 id 了
或者
把前面的那个select换成
delete
delete from test1 a where (a.phone,a.name) in (
select phone,name from test1 group by phone,name having count(*)>1 ) and id not in ( select max(id) from test1 group by phone,name having count(*)>1 );
mysql 查找除id外其他重复的字段数据
标签:重复 name group by pre test word 删除 keyword logs