Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

self join and update statement?

882169Aug 12 2011 — edited Aug 12 2011
Below is my table structure:

employees
---------
employee_id manager_id new_employee_id new_manager_id
1 A101
2 1 A102
3 1 A103
4 3 A104


How can I update the new_manager_id with the new_employeed_id maintaining the old employee, manager relationship? I can do this in sql server but I am just unable to an update with self join in Oralce. I tried to use the Merge and Using into did not help.

The output should be as below:

employees
---------

employees
---------
employee_id manager_id new_employee_id new_manager_id
1 A101
2 1 A102 A101
3 1 A103 A101
4 3 A104 A103
This post has been answered by Syed Ullah on Aug 12 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2011
Added on Aug 12 2011
4 comments
7,317 views