access表中删除相同的数据,是都删掉一条也不留。 
比如 1 




处理后变成 



请各位大侠帮忙帮忙给偶步骤和语句啊,不胜感谢!在线等……

解决方案 »

  1.   


    delete 表名 where 字段 in(select 字段 from 表名 group by 字段 having count(1)>1)
      

  2.   


    --或者:
    delete a from 表名 a,(select 字段 from 表名 group by 字段 having count(1)>1)b
    where a.字段=b.字段
      

  3.   

    --> 测试数据: s
    create table s(a int)
    insert into s
    select 1 union all
    select 2 union all
    select 2 union all
    select 9 union all
    select 8--删除重复
    delete a from s a,(select a from s group by a having count(1)>1)b
    where a.a=b.a--查看
    select * from s
      

  4.   

    declare @t table(id int)
    insert @t select 1 
    insert @t select 2 
    insert @t select 2 
    insert @t select 9 
    insert @t select 8 delete @t where id in(select id from @t group by id having count(*)>1)
    select * from @t
    /*
    id          
    ----------- 
    1
    9
    8
    */
      

  5.   

    ACCESS下测试通过:
    ---
    DELETE tb.*
    FROM tb 
    WHERE c1 IN 
          (
           SELECT c1 FROM ttt
           GROUP BY c1
           HAVING COUNT(c1)>1
          )
      

  6.   

    delete t
    from t1 t
    where
    (select count(*) from t1 where ID=t.ID)>1
      

  7.   


    delete tb where id not in (select id from tb group by id having count(id)=1)
    --or
    delete tb where id in (select id from tb group by id having count(id)>1)
      

  8.   


    DECLARE @t TABLE(id INT)
    INSERT INTO @t
    SELECT 1 UNION ALL
    SELECT 2 UNION ALL
    SELECT 2 UNION ALL
    SELECT 9 UNION ALL
    SELECT 8 DELETE FROM @t WHERE id IN (SELECT id FROM @t GROUP BY id HAVING COUNT(id)>1)
      

  9.   


    if object_id('tb') is not null
       drop table tb 
    go
    create table tb 
    ( a int)
    insert into tb select 1
          union all select 2
          union all select 2
          union all select 9
          union all select 8
    go----------------
      delete t from tb t join (select* from tb group by a 
          having(count(*)>1)) b
           on t.a=b.a 
    select * from tb 
      

  10.   

    DELETE @t WHERE id IN (SELECT id FROM @t GROUP BY id HAVING COUNT(id)>1)
      

  11.   

    --Access数据库删除语法是delete * from 表
    delete * from tb where id in (select id from tb group by id having count(id)>1)
      

  12.   


    delete tb where id in (select id from tb group by id having count(id)>1)
      

  13.   


    delete tb where id in (select id from tb group by id having count(id)>1)
      

  14.   

    delete tb where id in (select id from tb group by id having count(id)>1)
      

  15.   

    DELETE * FROM tb AS a
      WHERE (SELECT COUNT(*) FROM tb WHERE id=a.id)>1
      

  16.   

    http://topic.csdn.net/u/20081025/12/ad4cd175-449d-40a2-82c8-ac6829c31fe6.html?seed=1307498705详细情况大家可以来这里