Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie: delete from multiple tables?

Re: Newbie: delete from multiple tables?

From: Ian McCall <ian_at_eruvia.org>
Date: Thu, 17 Jul 2003 15:25:17 +0100
Message-ID: <jlyRa.11214$ju6.208251@newsfep4-glfd.server.ntli.net>

"abhijit" <abhi_at_nomail.com> wrote in message news:3F16AEB4.70802_at_nomail.com...
> delete table_1
> where table_1.field1 in (select table_2.field1 from table_2 )and
> table_1.field2 in (select table_2.field2 from table_2)

Won't that potentially delete rows where one field matches but not the other?

So...

table_1:
field1: 1
field2: 2

field1: 3
field2: 4

And table_2:
field1: 1
field2: 7

field1: 9
field2: 2

I -believe- (happy to be proved wrong...) that your statement above would match a row as table_1's field1 is in (1, 9) and table_1's field2 is in (7, 2). However, no row -should- be matched as no row in table_2 has a fields identical to those in table_1.

That not the case?

Cheers,
Ian Received on Thu Jul 17 2003 - 09:25:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US