oracle删除重复数据

insert into test values(1,'111');
insert into test values(2,'222');
insert into test values(3,'111');
insert into test values(4,'333');
insert into test values(5,'111');
insert into test values(6,'111');
----------------------将重复的删除, 按名称name-----------

delete   from   test   t1   where   rowid   >   (select   min(rowid)   from   test   t2   where   t1.name   =   t2.name and t1.name= t2.name)
如果存在多个列,在where 条件写就ok,比如 t1.name1 = t2.name1
select * from test

你可能感兴趣的:(oracle)