sql 当重复的数据有多条时,保留一条,删除其他重复

delete from proj_info where   newcode in (select newcode    from proj_info group by newcode      having count(newcode) > 1) and   NID not in (select min(nid) from proj_info group by newcode     having count(newcode)>1)

上一篇:sql 查询重复的数据


下一篇:Java编程规范(二)