select distinct * into #t from tbtrucate table tbinsert tb select * from #tdrop table #t

解决方案 »

  1.   

    select distinct * into #t from tbtruncate table tbinsert tb select * from #tdrop table #t
      

  2.   

    先看一下有多好重复的记录
    select appno,count(*) as geshu from [zhuanli] group by appno having count(*)>1id 最好是唯一值
    declare 
    @i int
    select @i=0
    while(@i<你要循环的次数即的到的记录)
    print @i
     delete from [zhuali] where id in(select id=min[id] from [zhuanli] group by appno having count(*)>1)
    select @i=@i+1
    loop
      

  3.   

    这里有删除重复行的详细办法,有几种可以去看看
    http://blog.csdn.net/sxycgxj/archive/2005/09/29/492250.aspx