how to run a delete query


G

Guest

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?
 
Ad

Advertisements

G

Guest

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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top