Tuesday, May 24, 2011

DELETE DUPLICATE ROW

-- delete duplicate rows from table

delete from scott.det d1
where rowid >
( select min(rowid) from scott.det d2 where d1.id = d2.id )

-- ANOTHER ALTERNATE WAYYYY...

delete from scott.det a
where rowid <> ( select max(rowid)
from scott.det b
where a.id = b.id
and a.des = b.des )

No comments:

Post a Comment