22,209
社区成员
发帖
与我相关
我的任务
分享
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