22,300
社区成员




update 表
set a=case when b='xxx' then '111'
case when b='XX' then '222'
else a--不满足则不更新
end
declare @B nvarchar(100)
set @B=...
或者
select @B=....
if(@B)
update a='111'
else
update a='222'
update a
set A=case when b.xxx='xxx' then '111' else '222' end
from a join b on a.id=b.id