delete from testtable a where (a.testcontent) in (select testcontent from testtable GROUP BY testcontent having count(*)>1) and seqid not in (select min(seqid) from testtable group by testcontent having count(*)>1)

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
几行Python代码,轻松搞定Excel表格数据去重
用几行Python代码,轻松搞定Excel表格数据去重
数据 原始数据 数据处理 Python处理数据 -
pgsql:count统计记录时去重
在count统计记录数时,如果想去重复字段的记录,可以用count(DISTINCT 字段名) 来过滤
postgresql 字段名 字段 -
es去重查询java elasticsearch查询去重
distinctFieldName 就是去重字段,这个字段必须是keyword类型 不然会报错
es去重查询java group by 字段 elasticsearch SQL