update a set a.值=b.值 from tabA a join tabA b on a.值=b.值
UPDATE a SET a.CompanyCode = b.DepartMentCode
FROM SP_FL_FanLiFactoryReturnMoney a
JOIN (
SELECT b.PrimaryKey,adm.DepartMentCode FROM SP_FL_FanLiFactoryReturnMoney b
INNER JOIN app_DepartMent adm
ON b.OperatCompany=adm.DepartName
) b
ON a.PrimaryKey=b.PrimaryKey