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 > ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| "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 |