how to run a delete query

B

b

i have created a delete query based on 2 tables - one is a mailing list, the
other a list of bad addresses. i would like the delete query to remove
records with "bad addresses" from the mailing list table. when i run the
query, i receive an error message that says "could not delete from specified
table". could you explain?
 
J

Jerry Whittle

You probably have a join between the two tables. What you need is a subquery
instead. It would look something like this:

DELETE Addresses.AddressID
FROM Addresses
WHERE Addresses.AddressID In
(SELECT BadAddresses.AddressID
FROM BadAddresses);
 
Top