Link to home
Start Free TrialLog in
Avatar of RegWood79
RegWood79Flag for United States of America

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of jorge_toriz
jorge_toriz
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ursangel
ursangel

delete from Animal2 where type in
(select type from animal1
group by type)
Avatar of RegWood79

ASKER

thanks jorge that's exactly what I was looking for.