互换两条记录中的字段值方法(有待测试,,)

update 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; 

posted @ 2014-01-15 11:11  北斗极星  阅读(174)  评论(0编辑  收藏  举报