select distinct * into #b  from 表
truncate table 表
insert into 表
select  *  from #b

解决方案 »

  1.   

    你直接执行下面的语句,然后把表2的名字改为表1 ,这样还保留了原来的数据,以备不测
    select distinct * into 表1  from 表2
      

  2.   

    SELECT COUNT(DISTINCT Citycode) AS Expr1
    FROM pub_city
      

  3.   

    insert into newtable select distinct * from oldtable
    truncate oldtable
    ========================
    oldtable和newtable有相同的表结构