欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

sqlserver一次性修改多条

程序员文章站 2022-04-01 17:40:57
修改客户表 编号为 0101007002,0101007003的楼栋号 007-1-102,007-1-201 UPDATE gas_customerSET building= CASEWHEN govid=380 and customer_no='0101007002' THEN '007-1-1 ......

修改客户表 编号为 0101007002,0101007003的楼栋号  007-1-102,007-1-201


update gas_customer
set building= case
when govid=380 and customer_no='0101007002' then '007-1-102'
when govid=380 and customer_no='0101007003' then '007-1-201'
end
where
govid=380 and customer_no in (
'0101007002',
'0101007003'
)