表test:
id priority
1 1
2 2
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;
交换两条记录中的字段值方法
最新推荐文章于 2021-04-13 04:49:46 发布