Unix Technical Forum

Re: Newbie: delete from multiple tables?

This is a discussion on Re: Newbie: delete from multiple tables? within the Oracle Miscellaneous forums, part of the Oracle Database category; --> "abhijit" <abhi@nomail.com> wrote in message news:3F16AEB4.70802@nomail.com... > delete table_1 > where table_1.field1 in (select table_2.field1 from table_2 )and > ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 09:03 AM
Ian McCall
 
Posts: n/a
Default Re: Newbie: delete from multiple tables?


"abhijit" <abhi@nomail.com> wrote in message
news:3F16AEB4.70802@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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com