|
What you can do is to create a table that contain the list of the duplicate rows, delete the duplicates and the re-insert them back in. Eg:
1. create table temp as select col1,col2,col3,col4,...coln,count(*) no_of_dups from mytable
where group by col1,col2,col3,col4,...coln
having count(*) > 1;
2. Delete these duplicate rows from your table:
delete from mytable where
col1||col2||col3||...coln in (select col1||col2||col3||...coln from temp);
3. Insert the rows you deleted back to the original table
insert into mytab select
col1,col2,col3,col4,...coln from temp;
4. drop the temp table
Drop table temp;
I hope this works....
Tiamiyu Salau
|