如何用sql删除表中相同的纪录?????

解决方案 »

  1.   

    delete * from
    tt
    where id in (
    select id from
    (
     select id ,count(id) from tt group by id
    ) as one
    where id > 1
    )
      

  2.   

    delete * from "你的表名" where 字段名="值" 
    就OK了!
      

  3.   

    理解错误!SORRY!
    楼上的就行
      

  4.   

    你的SQL语句将重复的记录都删除了,是否要剩余一条重复的记录,如果是真的那要用别的方法了
      

  5.   

    fenglaile() 说清楚点啊。。
      

  6.   

    delete from a where rowid in (select max(rowid) from a )
      

  7.   

    delete from tab where having count(*)>1
      

  8.   

    SQLServer:删除完全重复的记录,只留下一条:select distinct * into #temp from 表
    truncate table 表
    select * into 表 from #temp
    drop table #temp
      

  9.   

    或:删除重复的,只留一条:alter table 表 add  newfield int identity(1,1)delete 表
    where newfield not in(
     select min(newfield) from 表 group by 除newfield外的所有字段
                         )alter table 表 drop column newfield
      

  10.   

    大力,我执行了你的这段代码,怎么把我的所有记录都删除了呀?
    select distinct * into #temp from 表
    truncate table 表
    select * into 表 from #temp
    drop table #temp
      

  11.   

    把这句改一下
    select * into 表 from #temp
    为: insert into 表 select * from #temp