oracle中怎么在一个表中删去完全相同的项??

解决方案 »

  1.   

    delete from table
    where rowid not in 
    (select max(rowid) from table group by .....);
      

  2.   

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

  3.   

    delete from tablename
      where rowid <> (select max(rowid)
                        from tablename
                       group by field1, field2, field3 .. .);