当前位置:Gxlcms > 数据库问题 > sql过滤掉重复记录,只保留一条数据

sql过滤掉重复记录,只保留一条数据

时间:2021-07-01 10:21:17 帮助过:3人阅读

--过滤掉重复记录,只保留一条数据
delete from
gzfw_yhxx
where Zjhm in (select Zjhm from gzfw_yhxx group by Zjhm
having count(Zjhm) > 1)
and rowid not in (select min(rowid) from
gzfw_yhxx group by Zjhm having count(Zjhm
)>1)

sql过滤掉重复记录,只保留一条数据

标签:

人气教程排行