38 - 换座位 -- 方法一 select ( case when id%2=1 and id=(select max(id) from seat) then id when id%2=0 then id-1 else id+1 end) as id, student from seat order by id; -- 方法二 select if(id%2=0,id-1,if(id=(select max(id) from Seat),id,id+1)) as id,student from Seat order by id;