Trying to delete records using 2 tables

homer2002

Registered User.
Local time
Today, 21:06
Joined
Aug 27, 2002
Messages
152
Hi

I am trying to delete records from one table by matching a foreign key and a primary key across a link.

i.e.
_______________________________________

Table1

pk_Table1
Name
Address
Postcode

Table 2

pk_Table2
fk_Table1
ADate
SomeOther Information
_______________________________________

If I have a bunch of records in Table1
I would like to delete them from table 2.

Pk_Table 1 should match fk_Table 1 to delete.

Whenever I try to create a delete query it doesnt work.

Can anyone help?
 
Post the SQL for you delete query here. It should look something like:

DELETE *
FROM Table2 INNER JOIN Table2 ON Table1.pk_Table1 = Table2.fk_Table1;
 
Last edited:

Users who are viewing this thread

Back
Top Bottom