注意:如果学生人数为奇数,则不需要改变最后一个同学的座位

    1. select (case when id % 2 =0 and id !=(select count(*) from seat) then id-1
    2. when id % 2 !=0 and id != (select count(*) from seat) then id+1
    3. else id
    4. ) as id,
    5. student
    6. from seat
    7. order by id;