请问在Oralce中如何删除重复的记录..?--
create table student
(
  stuID varchar2(30),
  stuName varchar2(30),
  stuAge number   
)

解决方案 »

  1.   

    delete from student  a
    where exists (select 1 from student  b
        where b.stuName=a.stuName
        and (b.stuID<a.stuID
        or (b.stuID=a.stuID and b.rowid<a.rowid))
        );
      

  2.   

    不知道你怎么算重复的记录,假定三个字段,每个字段的值都一样才算重复。
    delete from student where rowid not in (select max(rowid) from student group by stuID, stuName, stuAge);
      

  3.   

    delete from student where rowid not in (select max(rowid) from student group by stuID, stuName, stuAge);