select * from table where name in (select name from (
select id,name,row_number() over(partition by name order by id) row_ from name)
where row_>1)
注释:table 被筛选的表的名称
name 可能出现重复的字段的名称
如果不需要先列出来,直接删除的话,语句为:
delete from tel where id in(
select id from (
select id,tel,row_number() over(partition by tel order by id) row_ from tel)
where row_>1)
如果要删除ID在前面的就改成 order by id desc