Re: Join Update Query ???

From: Tim McConechy <tmcconec_at_wie.com>
Date: 1997/11/03
Message-ID: <345E768C.D5387D08_at_wie.com>#1/1


This may give you some ideas!

Two tables:
TABLE_A
TABLE_B create view temp as select a.* from table_a a, table_b b

    where TABLE_A.FIELD_A = TABLE_B.FIELD_B and where TABLE_A.FIELD_ID = '0001'; Then:

Update TABLE_A set FIELD_ID = '0001AA'
where a.field1_That_is_unique||a.field2_that_is_unique||.... IN (select field1_That_is_unique||field2_that_is_unique||.... from temp);

Just watch that the view has the expected results first and check the column names (you may need to use to_char(on_a_number_field) for instance!

You really need only include the unique fields. Actually you could probably do it like this without the view?????

I have done this before and I am just guessing but something Like that should work!

James Wj Snyder wrote:

> Hello peoples,
>
> Again Oracle support has been no help <sigh> Anywho...
>
> I need to do an update query based on crieteria from a join. Any help
> would be appreicated.
>
> Two tables:
> TABLE_A
> TABLE_B
>
> Update TABLE_A set FIELD_ID = '0001AA' where
> TABLE_A.FIELD_A = TABLE_B.FIELD_B and where
> TABLE_A.FIELD_ID = '0001';
>
> Anything?
>
> --
> Peace,
> James Wj Snyder
> Wells Fargo Bank
Received on Mon Nov 03 1997 - 00:00:00 CET

Original text of this message