sun-rain

删除表中重复记录,只保留一条:

delete from 表名 where 字段ID in (select * from (select max(字段ID) from 表名 group by 重复的字段 having count(重复的字段) > 1) as b);


查询重复数据
select * from prpmlossitem where CaseNo in (
select CaseNo from prpmlossitem
group by CaseNo
having count(CaseNo) > 1
)

分类:

技术点:

相关文章: