在SQL SERVER中,关联表的批量更新。
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;