update
tb
set
name =
(case
when id = 1 then (
select
name
from
tb
where
id = 2)
when id = 2 then (
select
name
from
tb
where
id = 1)
end)
where
id = 1
or id = 2;

  

posted on 2020-12-15 22:52  mljqqh  阅读(231)  评论(0编辑  收藏  举报