Finding and Removing duplicate data from SQL Tables

Posted on Sunday, May 9th, 2010 at 4:50 pm in Uncategorized.

Here’s an decent article with various methods of finding duplicate data in databases with SQL.

http://www.delphifaq.com/faq/delphi/database/f20.shtml

Removing duplicate data can be a troublesome task as well. One of the fastest ways to do so involves creating a new table with a unique index to the column you wish to purge of duplicate data.

Then you copy data over form the original table to the new using a insert ignore into table ( columns ) select columns from table type of query. Don’t forget the “ignore” otherwise the batch insert will fail at the first case of a duplicate piece of data.

Add Your Comment


Top