[原创]删除重复记录的另一种方法

while exists (select count(*) from tablea group by col1 having count(*)>1  )
begin
delete top (1) from tablea where col1 in(
select col1 from tablea
group by col1 having count(*)>1
)
end

posted on 2009-11-10 08:51  highmayor  阅读(156)  评论(1编辑  收藏  举报

导航