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