How to remove duplicate records from two different tables

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?
RegWood79Asked:
Who is Participating?
 
jorge_torizResearch & Development ManagerCommented:
DELETE Animal2
WHERE ID IN (SELECT ID FROM Animal1)
0
 
ursangelCommented:
delete from Animal2 where type in
(select type from animal1
group by type)
0
 
RegWood79Author Commented:
thanks jorge that's exactly what I was looking for.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.