UPDATE B SET B.loginname=c.loginname FROM t_employee A, t_systemuser B, oa_employee c WHERE A.employeeid=B.belonguserid AND A.oaemployeeid = c.id