批量删除重复数据,只保留一条

有唯一的主键标识

update pkb_rdxzXs set IsDelete=1 where  id in (select MAX(id) from pkb_rdxzXs where IsDelete=0 group by rdxz_id,xs_vid,xs_xh having count(*) > 1) 

 

参考:SQLServer删除重复数据记录

posted @ 2018-10-15 10:55  linyongqin  阅读(205)  评论(0编辑  收藏  举报