 UPDATE EXAM_PART SET DEPTCODE=T.HISCODE FROM 
(
SELECT Name	,HISCode  FROM DICT_DEPT) T
WHERE T.NAME=EXAM_PART.DeptName AND EXAM_PART.DeptCode=0141