先将结果集查询出来,然后使用结果集临时表和update表做join关联,set需要修改的表的字段
update resources r join
(select dic.code
,s.id from system.s_dictionary dic join (select rm.id,rf.name from ty.resource_main rm join ty.resource_filetype rf on rm.fileTypeId=rf.id) s
on s.name=dic.name) a on r.id=a.id set r.fileType=a.code