首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

互换两条记录中的字段值方法

2012-08-08 
交换两条记录中的字段值方法表test:idpriority1122update test set priority(case when id1then (select

交换两条记录中的字段值方法

表test:    id         priority    1             1    2             2update test set priority=(case when id=1  then (select priority from test where id=2) when id=2 then (select priority from test where id=1) end) where id=1 or id=2;
?

热点排行