top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

+1 vote
491 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
...