Solved

How to remove duplicate records from two different tables

Posted on 2008-09-29
3
303 Views
Last Modified: 2012-06-27
HI everybody,

I have two database tables

Animal1
ID                  Type               Name
1                    cat                   felix
2                    dog                   ruff
3                    dog                   rover
4                    dog                   skip
5                    cat                    heathcliff

Animal2
ID                 type                   Name
1                  cat                     felix
4                   dog                   skip
3                  horse                   ED

Now if i have duplicate records in both tables I need to delete the duplicates from the "animal2" table. How can i do that?  Is there a way to write a query to do this?
0
Comment
Question by:RegWood79
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 200 total points
ID: 22601963
DELETE Animal2
WHERE ID IN (SELECT ID FROM Animal1)
0
 
LVL 5

Expert Comment

by:ursangel
ID: 22602985
delete from Animal2 where type in
(select type from animal1
group by type)
0
 

Author Closing Comment

by:RegWood79
ID: 31501418
thanks jorge that's exactly what I was looking for.  
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question