Forums
This topic is locked
where it does not equal
01 Apr 2002 12:22:42 Sill Sill posted:
howdy, newbie hereI need to select records from one table that have been orphaned so I can delete them.
Is there a way of selecting only the records where the ProductID in one table DOES NOT equal the ProductID in another?
This little problem has been a thorn in my side ... any help would be great
thanks
Replies
Replied 01 Apr 2002 20:21:05
01 Apr 2002 20:21:05 Owen Eastwick replied:
You can do it all in one operation:
DELETE FROM Table2 WHERE RecordID NOT IN (SELECT RecordID FROM Table1)
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
DELETE FROM Table2 WHERE RecordID NOT IN (SELECT RecordID FROM Table1)
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo