实现2个表的联合update

update spot s set s.name = (select ss.outername from spotregister ss where s.spotcode = ss.spotcode and ss.outername is not null),
s.outername =  (select ss.outername from spotregister ss where s.spotcode = ss.spotcode and ss.outername is not null)
where s.spotcode in  (select ss.spotcode from spotregister ss where s.spotcode = ss.spotcode and ss.outername is not null)

你可能感兴趣的:(update)