首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

这两条更新语句怎么合并一条 请问

2012-10-31 
这两条更新语句如何合并一条 请教update tb_ContactPerson set is_default 1where ID 70update tb_Con

这两条更新语句如何合并一条 请教
update tb_ContactPerson set is_default = 1
where ID = 70

update tb_ContactPerson set is_default = 0
where ID not in(70) 
这两条更新语句如何合并一条 请教

[解决办法]
case...when 语法,看sqlserver帮助
[解决办法]
update tb_ContactPerson set is_default = (Case ID When 70 then 1 else 0 end)
[解决办法]
update AA_ContactPerson set is_default = (case when (ID =70) then 1 else 0 end)

热点排行