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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to SELECT info from one table that is not in another table.

Status
Not open for further replies.

VBSQL

Programmer
Jun 14, 2001
2
US
I have two tables that are linked with the same ID number's
One holds Orderinfo and the other Iteminfo, I need to SELECT the ID's that are in the table with the Orderinfo where the ID does not exist in the Iteminfo table and then remove it from the Orderinfo table. All of this is being done with in a VB Program using recordsets. Do You Have any Ideals to help!

Thanks.
 
Test it first, but if you are using embedded sql then

Delete from Orderinfo
where Orderinfo.ID not in
(select Iteminfo.ID from Iteminfo)


will delete the entire set of records. If you only want to
clear the id in Orderinfo, use an update statement, instead. Jim

oracle, vb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top