select distinct * into temptable from tablename
go
truncate table tablename
go
insert tablename
select * from temptable
go
drop table temptable
go

解决方案 »

  1.   

    前面太多这样的帖子,可惜网络太慢
    假使表中只有name,num2字段
    delete a
    from #t1 a
    where exists(select name,num from #t1 where name=a.name and num=a.num group by name,num having count(*)>1)
      

  2.   

    select distinct * into #temptable from tablename
    delete tablename
    go
    insert into tablename from select * from #temptable
    go
      

  3.   

    select distinct * into #temptable from tablename
    delete tablename
    go
    insert into tablename from select * from #temptable
    go