方法一:
mysql语句如下:
update question set sort=(case when id=7 then (select a.sort from (select tmp.* from question tmp) a
where a.id=8) when id=8 then (select a.sort from (select tmp.* from question tmp) a where a.id=7) end)
where id=7 or id=8;
方法二:
update question as q1 join question as q2 on (q1.id=7 and q2.id = 8)
or(q1.id = 8 and q2.id=7)
set q1.sort = q2.sort,q2.sort=q1.sort;