Removing duplicate rows from Oracle tables with SQL can be very tricky, and there are several techniques. This post shows some examples of using SQL to delete duplicate table rows using an SQL sub query to identify duplicate rows, manually specifying the join columns:
DELETE FROMtable_name A
WHERE
a.rowid >
ANY (
SELECT B.rowid
FROM
table_name B
WHERE
A.col1 = B.col1
AND
A.col2 = B.col2
);
For a script that does not uses ROWID concept, read this post.
No comments :
Post a Comment