更新同一张的数据表,将父ID赋值为对应的ID(根据父编码等于部门编码) update dept2 set parentdeptId=dept1.ID from BO_BY_HR_CREATE_DEPT dept1,BO_BY_HR_CREATE_DEPT dept2 where 1=1 and dept2.parentdept_code = dept1.dept_code