Delete Query using another table as criteria

E

Erika

I have 2 tables CurrentAssoc & RetiredAssoc - I want to delete all of the
retired associates from the Current Associates table.

Field names in both are
EmployeeID
Department
Date

I have found a lot of SQL statements that I am having a difficult time
deciphering, I am wondering how to set that up in design view.
 
M

MGFoster

Erika said:
I have 2 tables CurrentAssoc & RetiredAssoc - I want to delete all of the
retired associates from the Current Associates table.

Field names in both are
EmployeeID
Department
Date

I have found a lot of SQL statements that I am having a difficult time
deciphering, I am wondering how to set that up in design view.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Two ways in SQL view:

Method one:

DELETE CA.*
FROM CurrentAssoc As CA INNER JOIN RetiredAssoc As RA ON CA.EmployeeID =
RA.EmployeeID

Method two:

DELETE *
FROM CurrentAssoc
WHERE EmployeeID IN (SELECT EmployeeID FROM RetiredAssoc)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSb+/LoechKqOuFEgEQIizACg89YGmQz6IhPx5CpLZ2MohgYbrQ8An0ic
BAOS+WVZcHbgWzsW3ft3sZy9
=Jalt
-----END PGP SIGNATURE-----
 

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