delete duplicate rows of data and leave 1 remaining

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have duplicate rows of the same data. How can I update the table and
remove the extra rows of data and leave only 1 row?
 
Hi,


Append the data into a table not allowing duplicated values (through an
index). Some records won't be appended, that is what you want, since there
is duplicated values.


Alternatively, use a SELECT DISTINCT or a GROUP BY query.

Hoping it may help,
Vanderghast, Access MVP
 
First you need to exactly define what is a duplicate. If you mean that every
little bit of information in every field is exactly the same in more than one
record, lucky you.

First make a complete backup of the database. Make a select query that adds
all the fields in the table. Modify the SQL to say SELECT DISTINCT. Run the
query and make sure that it looks right. Modify this query into a make table
query and run it. Now all the duplicates are gone.

Next go to the Relationships window and see if the table with the dupes has
any relationships defined with Referiential Integrity applied. If so you may
have some major problems shortly. As you say the records are duplicates,
there must be not primary keys so I doubt it.

Next try deleting all the records in the table with dupes. (That's why I say
make a complete backup above). If it says it can't, stop right there. If it
will delete the records, do so. Then make an append query out of the new
table above and pour them into the original table.

Above is the easiest scenerio. If you have referiential integrity applied;
only a few fields constitute a duplicate; or can't say exactly what makes a
record a duplicate, things get a lot more difficult.
 
Back
Top