Best update clause

Best update clause

 

  

All, I have a very large table (8 million rows) that I need to update and
was wondering the best sql.

I need to set the column (supervisor) equal to the column (department) in
the table. I'm not even sure I have the clause right. Anyhelp would be
appreciated.


Sql :

update employee e
set e.supervisor = (select d.department
from employee d
where d.company=10
and d.company = e.company
and d.department= e.department
and d.employee = e.employee)
where e.company = 10;

or

update employee e
set e.supervisor = e.department
where company = 10;


thanks,

Brad

Oracle LazyDBA home page