Delete Query

dark11984

Registered User.
Local time
Tomorrow, 05:54
Joined
Mar 3, 2008
Messages
129
I have 2 tables, [Prod Code data table] & [comment table]. I want to delete all records in the comment table where the prod code does not appear in the prod code data table. Is this possible?
 
Code:
delete from [comment table] where [prod code] not in
(select [prod code] from [Prod Code data table];

You really shouldn't use spaces or special characters in table/column names.
 

Users who are viewing this thread

Back
Top Bottom