626. 换座位
题目链接:626. 换座位
代码如下:
cpp
# Write your MySQL query statement below
select
if(id%2=0,
id-1,
if(id=(select count(distinct id) from seat),
id,
id+1)
)as id,
student
from Seat
order by id asc