不要编程实现,因为那样速度太慢了!

解决方案 »

  1.   

    什么数据库?
    你实现给我看!谁一条sql语句能写出我出200给他!(不准使用中间表和存储过程)
      

  2.   

    select top 1 * into #temp from yourtable where yourkey =yourvalue
    delete * from yourtable where yourkey=yourvalue
    insert into your table select * from #temp
      

  3.   

    我们都是这样处理的:
    先建一个中间表,在中间表将你认为相同的那个字段建上唯一索引,随后将数据倒到那个表里(注意此时检查数据是否正确)再truncate以前的表,再将中间表的数据倒到以前的表中再drop中间表。
      

  4.   

    select distinct *  into tmp from for_rep
    drop table for_rep
    EXEC sp_rename N'[dbo].[tmp]', N'for_rep', N'object'