Question about relational delete query

Question about relational delete query

Post by ja » Thu, 26 May 2005 03:49:19


Hello,

I am new to ms access. I am trying to do a relational delete query.
Here is what I would do in ms sql:

delete t1
from t1, t2
where t1.f1 = t2.f1

I've been trying to to do it in ms access 2002 using the wizard,
desing and sql modes. I can't figure out what ms is requesting me to
do.

Would you help me?

tia

ja
 
 
 

Question about relational delete query

Post by Steve Jorg » Thu, 26 May 2005 04:35:58


I think what you need is...

DELETE t1.*
FROM t1
INNER JOIN t2
ON t1.f1 = t2.f1

 
 
 

Question about relational delete query

Post by MacDermot » Thu, 26 May 2005 08:27:36

I've had better luck doing it this way:

DELETE t1.*
FROM t1
WHERE t1.f1 IN (SELECT DISTINCT t2.f2 FROM t2)