I have a table with composite primary key(a,b). I took a backup in temp table but some how there came the duplicate records. now am not able to move the backup records to main table.
kindly suggest some way to delete the duplicates in the temp table based on 2 columns. Table is oracle table with 70 million records around 4 million duplicates
You have two options:
The second one is more efficient and can be done using this statement:
As an alternative (e.g. when some of the columns are defined as
CLOBorLONGand you can’t apply a max() on them):If you really want to first delete the rows, you can do this with the following statement: