一、通过Mod()判断奇数偶数 select ( case when mod(id,2)=0 then id -1 when mod(id,2)=1 and id = (select count(id) from seat) then id when mod(id,2)=1 then id+1 end)as id, studentfrom seat order by id