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

Home -> Community -> Usenet -> c.d.o.server -> Update with multiple tables

Update with multiple tables

From: Ian Dodds <ian_at_iandodds.freeserve.co.uk>
Date: Tue, 25 Jun 2002 12:27:01 +0100
Message-ID: <zvYR8.903$Z_6.191464@news6-win.server.ntlworld.com>


Hi,

I have 2 database tables. I need to update a column in one table with that in another. Somehow I need to have a join in the update statement but I can't get it to work.

Take the following SQL which works fine in SQLServer.

update table1 set table1.col1 =
table2.col1
from table2, table3
where table2.col2 = table1.col2 and table2.col3= table3.col1 and (table2.col3= 'CNI' or table2.col3 = 'CN2' or table2.col3 ='CSS') and table3.col2= 'Y';

If anyone has any ideas, it would be appreciated. the Oracle help seems to be poor when trying to find out how to do an update with multiple tables.

Thanks

Ian Received on Tue Jun 25 2002 - 06:27:01 CDT

Original text of this message

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