读书人

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

发布时间: 2012-08-08 14:32:45 作者: rapoo

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

表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;
?

读书人网 >其他数据库

热点推荐