top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

how to update table using values of multiple columns from other tables in Oracle SQL

+1 vote
199 views

Do i need to write in PL/SQL or is it possible in SQL query?

posted Sep 12, 2014 by Archana

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

yes, simple update statement does this:

UPDATE table_name1 T1
SET (id, name) =
(SELECT T2.id, T2.name
FROM table_name2 T2
WHERE T1.REF = T2.REF)
WHERE EXISTS
(SELECT 1
FROM table_name2 T2
WHERE T1.id = T2.id);

answer Sep 12, 2014 by Vidhya Sagar
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...