假设该表名为ABC
delete from ABC a where a.rowid!=(select max(rowid) from ABC b where a.a=b.a and a.b=b.b and a.c=b.c);
我已在数据库上试过!

解决方案 »

  1.   

    delete from tbname where rowid not in(
    select max(rowid) from tbname group by a,b);
      

  2.   

    delete from tab A
    where rowid>(select min(rowid) from tab B where A.a=B.a and A.b=B.b)
      

  3.   

    delete from ABC a where a.rowid!=(select max(rowid) from ABC b where a.a=b.a and a.b=b.b and a.c=b.c)

    delete from tbname where rowid not in(
    select max(rowid) from tbname group by a,b)
    任何一种方法都可以实现,两种方法没有什么本质的区别
      

  4.   

    select distinct * into #t from ABC
    delete from ABC
    insert into ABC 
    select * from #t
    drop table #t
      

  5.   

    楼上的兄弟,oracle不支持这样的语法创建表吧
      

  6.   

    delete from ABC a where a.rowid not in(select max(rowid) from ABC b where a.a=b.a and a.b=b.b and a.c=b.c)