I have somehow lost my key field in a table. now there are thousands of duplicate records. does access have a function on deleting duplicate records? My problem is, I would still need to leave one of each record in the DB.
If you have a unique key on the table such as an auto number then you can use this approach.
delete from table as outertab
where outertab.autokey >
(select min (innertab.autokey)
from table as innertab
where outertab.yourdupkey = innertab.yourdupkey)
In this example, if the autokeys match (only one record) then it will not delete otherwise it will delete (multiples of yourdupkey). Of course, you should test before applying.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.