Delete duplicate record

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

Guest

Hello,
I have a table sometime contain 2,3,5,10 duplicate records. How can I delete
all of them and keep just 1 record.
Thank you for any help.
 
Hi,


As for your previous question:


SELECT f1, f2, LAST(f3), LAST(f4)
FROM myTable
GROUP BY f1, f2


Another alternative is to define a table with no duplicated entry, and then,
append all the data to it. Duplicated record will be, by default, with Jet +
DAO, removed, but one entry will still make its way in the table. With MS
SQL Server, you can do the same (for the table thing, not the LAST( )
aggregate since it does not exits in MS SQL Server) if you first set the
option IGNORE_DUP_KEY. Indeed, with MS SQL Server, the default behavior will
be to rollback the whole transaction if ONE error occur and so, finding one
duplicate, the whole INSERT will be rollback, unless you set the mentioned
option.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top