Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete from table 1

Status
Not open for further replies.

georgia51390

Programmer
May 17, 2001
13
US
I have a question about deleting rows from a table. I have 2 tables of patient data (group number, birthdate, gender). I want to delete all those from table A that are also in table B, but I need for them to have a matching group number, birtdate, AND gender to be deleted. They have to match on all 3 to be removed. Is that possible? Thanks!
 
delete from taba where col1 in (select col1 from tabb where taba.col1=tabb.col1)
and col2 in (select col2 from tabb where taba.col2=tabb.col2)
and
col3 in (select col3 from tabb where taba.col3=tabb.col3)

would delete rows from taba that have predicates in tabb Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top