使用一条语句批量修改数据,使用where和case when:
update tblUpdate
set Col2 = (case when Id = 1 then '第三次修改5'
when Id = 2 then '第三次修改5'
else '第三次修改5'
end
)
where Id = 1 or Id = 2;
使用一条语句批量修改数据,使用where和case when:
update tblUpdate
set Col2 = (case when Id = 1 then '第三次修改5'
when Id = 2 then '第三次修改5'
else '第三次修改5'
end
)
where Id = 1 or Id = 2;