In the case the number of duplicate rows is reasonably small and that we don't really care which row we leave/delete out f the duplicate ones, we could use the delete below to eliminate these rows.
In the case where the number of duplicate is very big, we need to avoid the delete and use "create table as select", to leave only the desired rows.
DELETE FROM dup_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM dup_table
GROUP BY column1, column2, column3);
No comments:
Post a Comment