Delete Duplicate Rows From an Oracle Table

It’s easy to introduce duplicate rows of data into Oracle tables by
running a data load twice without the primary key or unique indexes
created or enabled.

Here’s how you remove the duplicate rows before the primary key or unique indexes can be created

DELETE FROM our_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM our_table
GROUP BY column1, column2, column3... ;

The GROUP BY is used on the columns that make the primary key for the table
column1, column2, column3 constitute the identifying key for each record.

http://www.devx.com

One thought on “Delete Duplicate Rows From an Oracle Table

  1. No matter if some one searches for his required thing, so he/she desires
    to be available that in detail, thus that thing is maintained over here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s