当前位置: 代码迷 >> SQL >> sqlserver2005查看重复并剔除
  详细解决方案

sqlserver2005查看重复并剔除

热度:147   发布时间:2016-05-05 09:48:53.0
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最小的记录

  相关解决方案