`

sqlserver2005查看重复并删除

阅读更多
delete from web_site 
where title  in (select  title  from web_site  group  by  title  having  count(title) > 1) 
and [id] not in (select min([id]) from  web_site  group by title  having count(title )>1) 

 删除表中多余的重复记录,重复记录是根据单个字段(title)来判断,只留有id最小的记录

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics