我有以下查询:
update a
set dwc=fa.dwc
from b fa
join a mw
on a.fa_state=b.state
where b.dwc=''
;
update a
set dwa=fa.dwa
from b fa
join a mw
on a.fa_state=b.state
where b.dwa=''
我试图合并为一个-可能吗?
答案 0 :(得分:1)
在set
子句中可以有几个column子句。您只需要用逗号(,
)将它们分开:
update a
set dwc=fa.dwc, dwa=fa.dwa -- Here!
from b fa
join a mw
on a.fa_state=b.state
where b.dwc=''