解决方案 »

  1.   


    IF object_id('tempdb..#cu') is not null
    DROP table #cu;;with a1 (zd1,zd2,zd3) as
    (
    select 'a','b','c' union all
    select 'a','b','c' union all
    select 'a','b','c' union all
    select 'a1','b1','c1'
    )
    select * into #cu from a1;with a1 as
    (
    select *,ROW_NUMBER() OVER(PARTITION BY zd1,zd2,zd3 ORDER BY GETDATE()) re
    from #cu
    )
    delete a1 where re>1select * from #cu
      

  2.   

    distinct 所有列,把结果放到一个临时表,清空原表,再把临时表的数据导来,确认后,删除临时表。