一、通过Mod()判断奇数偶数
    image.png

    1. select
    2. (
    3. case
    4. when mod(id,2)=0 then id -1
    5. when mod(id,2)=1 and id = (select count(id) from seat) then id
    6. when mod(id,2)=1 then id+1
    7. end
    8. )
    9. as id, student
    10. from seat
    11. order by id