self join and update statement?
882169Aug 12 2011 — edited Aug 12 2011Below 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