Diary of an idiot

Saturday, October 21, 2006

Removing Duplicates from an Oracle Table

Another method to de-duplicate an Oracle table is via analytical SQL:

delete /*+ FIRST_ROWS */ from


where rowid in (select rid from ( select rowid rid
, row_number() over ( partition by
,
,....
,
order by rowid ) rn
from
where
)
where rn > 1);