Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Compare Two tables

Author  Topic 

nhatto
Starting Member

2 Posts

Posted - 2009-11-11 : 16:08:23
Hello

I have Two Tables ( Table A and Table B)

Table A has one field : email
Table B has three Fields : First name, Last name , email

I want to check if the email in Table B is found in Table A, And if it is , then I want to delete the row ( First name, Last name , email ) from Table B that has that email.

any help is really appreciated and thank you in advance!

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-11 : 16:11:46
delete b
from tableB as b
join tableA as a on a.email=b.email


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -