大概这样:
delete from employee where rowid not in (
  select max(t1.rowid) from employee t1 group by t1.emp_id,t1.emp_name,t1.salary);-

解决方案 »

  1.   

    DELETE FROM tabNameWHERE ROWID > (SELECT MIN(ROWID) FROM tabNameGROUP BY  a,b,c);
      

  2.   

    这两种方式太慢了,我用PL/SQL测试了一下,都没反应,还可以用创建一个临时表的方式
    create T_bak as select distinct A,B,C from T
    但是,问题是创建的临时表还有id列没法对应地插入进去
    请高手们提点一下,急啊
      

  3.   

    create T_bak as select distinct rownum id,A,B,C from T
      

  4.   

    to
    ljfdd(夜风之舞):
    可是ID不属于distinct,distinct用了之后结果不是与原来的是一样的么
     id A B C
     1  2 2 3
     2  2 2 3
     3  3 4 5
     4  5 7 8
     5  3 4 5
      

  5.   

    在大表中删除数据本来就很慢的。但有办法可改进,如分批删除,利用库缓存提高执行速度
    看看这个:
    Oracle中大批量删除数据的方法
    http://www.eygle.com/archives/2005/04/oracleoeouaeeae.html条件就按2楼的即可。
      

  6.   

    不好意思..疏忽了..Create Table A_tmp (A Number ,b Number ,c Number );Insert Into A_tmp Values (2,2,3);
    Insert Into A_tmp Values (2,2,3);
    Insert Into A_tmp Values (3,4,5);
    Insert Into A_tmp Values (5,7,8);
    Insert Into A_tmp Values (3,4,5);
    Commit;Select rownum Id ,A,B,C From 
    (select distinct A,B,C from a_Tmp)结果
    1 2 2 3
    2 3 4 5
    3 5 7 8
      

  7.   

    create table T_bak as Select rownum Id ,A,B,C From 
    (select distinct A,B,C from A_tmp)
      

  8.   

    如果在大量的数据中删除少量的重复数据可以:
        delete from t
         where rowid in
               (select min(rowid) from t group by a, b, c having count(*) > 1);
    重复几次就好了!或要着写成程序块
    declare
    begin
      loop
        delete from t
         where rowid in
               (select min(rowid) from t group by a, b, c having count(*) > 1);
        commit;
        if sql%rowcount = 0 then
          exit;
        end if;
      end loop;
    end;
      

  9.   

    delete from tableName where id not in
    (
      select id from
      (
        select A,B,C,max(id) from tableName group by A,B,C
      )
    )
      

  10.   

    顶一个,cxjd(dong) 的解决方案是对的
      

  11.   

    怎么都那么喜欢用not in,考虑下效率吧
    delete from tableName where not exists
    (
      select id from
      (
        select max(id) id from tableName group by A,B,C
      )
      where id = tableName.id
    )