UPDATE TABLE WITH JOIN
Date: 22 Jan 2002 10:31:04 -0800
Message-ID: <b6ab8a8e.0201221031.753fe23d_at_posting.google.com>
The query like this, works fine in Microsoft SQL SERVER
UPDATE TABLE table1 t1 SET
t1.col1 = t2.col1,
t1.col2 = t2.col2
t1.col3 = t2.col3
FROM table2 t2, table t3
WHERE t1.col1 = t2.col1
AND t2.col2 = t3.col1
etc...
The main idea is to update a table with values in other one or more
tables by joining the tables.
AS FAR AS I KNOW
ORACLE doesn't support FROM clause in UPDATE statement (like I used in
above example). I can work around If I have fixed values to update the
table.
Or other way is to use a subquery (SELECT col1 from ....) with join
condition for each column to update.
I want to know is there any better way to do that (IN ORACLE), I want
to avoid many subqueries.
If any one knows please help.
Regards.
Toqeer Sardar
Received on Tue Jan 22 2002 - 19:31:04 CET