remove duplicates - impossible?

Pyro

Too busy to comment
Local time
Tomorrow, 06:31
Joined
Apr 2, 2009
Messages
127
Hi,

Consider the following scenario:

  • 1 table
    • Approx 20 fields.
    • >1,000,000 records.
    • No PK.
    • A reference to a FK that relates to an order number.
    • Some records are legitimate duplicates (i.e. they exist b/c they are separate records).
    • Someone comes along and (accidentally) copies a whole bunch of these records, creating erroneous duplicates.
Apart from the fact that a table like this makes one feel dirty just looking at it, is there any way to find and remove these erroneous duplicates? Or is this a completely lost cause. At this point in time, I am going with the latter.

Just thought I would put it out there in case, you know... magic is real, and the world has been lying to me from day 1.
 
Are there any backups of the database from before the incident? If so, I'd:

-not revert to that, but I'd use it as a reference - looking for records that have the same FK in both tables, but more records in the later-dated table - mark them and then deal with them by hand.

Or

Empty the current table of everything that should be in the backup (i.e. including the duplicated records) and append the unsullied data in from the backup table.
 

Users who are viewing this thread

Back
Top Bottom