Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Join on vs intersect, for update query with Multiple tables??
qazmlp1209_at_rediffmail.com wrote:
> For the given problem, we have arrived at 2 solutions:
>
> Solution-1:
>>> update tab2 t2_alias >>> set col_c_2 = null >>> where exists >>> (select col_a_1 >>> from >>> (select col_a_1, col_b_2, col_C_2, count(col_a_1) over (partition by >>> col_a_1 >>> order by col_a_1) as data_count >>> from tab1 >>> join tab2 on (col_a_1 = col_a_2) >>> where col_b_1 = 'true' >>> ) >>> where data_count = 1 >>> and col_a_1 = t2_alias.col_a_2)
>> UPDATE tab2 >> SET col_c_2 = null >> WHERE col_a_1 IN >> ( SELECT col_a_1 FROM tab1 WHERE col_b_1 = 'true' >> INTERSECT >> SELECT col_a_2 FROM tab2 GROUP BY col_a_1 HAVING count(1) = 1 >> );
No. Is there something preventing you from running them?
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Mon Jan 29 2007 - 13:19:15 CST