关联表的批量更新(ORACLE)


在SQL SERVER中,关联表的批量更新,可以参看这里:

http://blog.csdn.net/downmoon/article/details/1301932


Oracle下没找到好的语法,临时用这个:

update employee  set hrdeptname=
(select d.DEPTNAME from DEPARTMENT d
where ROWNUM=1 and d.deptID=employee.hrdeptID
)


对应的SQL Server语法:

Update employee set hrdeptname=d.DEPTNAME
from DEPARTMENT  d  inner join employee e  on e.HRDEPTID=d.DEPTID
where 1=1;


邀月注:本文版权由邀月和CSDN共同所有,转载请注明出处。
助人等于自助!   [email protected]


你可能感兴趣的:(关联表的批量更新(ORACLE))