How to delete intersection of two tables?

From: Peter Hubel <ludvig_at_daimi.aau.dk>
Date: Wed, 14 Apr 93 07:46:21 GMT
Message-ID: <1993Apr14.074621.7524_at_daimi.aau.dk>


Hi netters,

I'm quite a novice into Oracle SQL and I have this problem.

I have two tables (T1 and T2) which have two fields (let's call them A and B) in common. The goal is to remove all rows in T1 which match a row in T2 w.r.t A and B.

I've tried something like

	DELETE FROM T1 x 
	WHERE A = (SELECT A FROM T2 y WHERE T1.B = T2.B)

but it doesn't seem to work at all.

Any suggestions, anybody?
Thanks in advance

---peter

-- 
******************************************************************************

* Peter Huebel E-mail: ludvig_at_daimi.aau.dk *
* Department of Computer Science, University of Aarhus, Denmark *
****** Warning - this signature is only valid for large values of 2 **********
Received on Wed Apr 14 1993 - 09:46:21 CEST

Original text of this message