带条件进行更新关联:
update 表1 set 字段= (select 字段 from 表2 where 表2.user_fullname = 表1.VISITDOCTOR and length(表1.visitdoctorcode) < 30 and 表1.VISITDOCTORCODE = VISITDOCTOR and 表2.teamid=表1.Operunitcode) where exists( select 1 from 表2 where 表2.user_fullname = 表1.VISITDOCTOR and length(表1.visitdoctorcode) < 30 and 表1.VISITDOCTORCODE = VISITDOCTOR and 表2.teamid=表1.Operunitcode)
原文链接:https://www.f2er.com/oracle/212312.html