Posted on Sunday, 3rd May 2009 by Balazs
To delete records where only a field is duplicated, we can use a similar technique to the general duplicate removal technique:
CREATE TABLE temp AS SELECT DISTINCT ON (email) * FROM table_to_deduplicate;
DROP TABLE table_to_deduplicate;
ALTER TABLE temp RENAME TO table_to_deduplicate;
Be mindful of the fact that this process will not preserve the constraints on the original table. So [...]
Tags: DB2, IBM, MySQL, Oracle, PostgreSQL
Posted in DB2, Technology | Comments (Comments)