delete duplicate records

F

Finger Tips

I have a database which lists duplicate records. I want to delete all
duplicates records that have the same info in a specific field. I think if I
use the addr field it should work. Here is the sql

SELECT dbo_comps11.title AS dbo_comps11_title, dbo_comps11.addr,
dbo_comps11.city, dbo_comps11.state, dbo_comps11.zip, dbo_comps11.phone,
dbo_paths.id, dbo_paths.title AS dbo_paths_title, dbo_paths.parent
FROM dbo_paths INNER JOIN ((dbo_comps11 INNER JOIN dbo_links ON
dbo_comps11.id = dbo_links.id) INNER JOIN dbo_dirs ON dbo_links.parent =
dbo_dirs.id) ON dbo_paths.id = dbo_dirs.parent
WHERE (((dbo_paths.parent)=60003));
 
O

Ofer Cohen

First thing, create a back up to your DataBase.

I find that the easiest way to do that is create a new table, the same
structure as the first one, but add to it a key where you don't want
duplicates.
Append all the records from the Old table to the new one, only the first
record will be appended to this table, and by crating a new table with the
key, the user won't be able to insert duplicates again.
 

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

Top