需求:
主表中部分责任人名字是工号,需要join员工表,把主表中工号更新为人名
update mian_table as a
set responsible_person = b.employee_name
from dim_pub_employee as b
where a.responsible_person = b.employee_num
and a.responsible_person like '10%' -- 工号为10开头
注意:set后面的主表字段不要加别名