626. 换座位

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
相关推荐
Joy T5 小时前
MySQL Outbox、Redis Streams 与 LangGraph——如何构建可靠的异步 AI Agent
数据库·redis·mysql·任务队列·redis streams·mysql outbox
FungLeo5 小时前
FengCMS · PHP+MySQL 升级实录· 回归测试从 69 项到 478 项:HTTP/数据库回归套件怎么搭
数据库·mysql·php·回归测试·fengcms
小小程序员.¥7 小时前
mysql备份以及数据恢复实战
数据库·mysql
wno7047 小时前
Nginx代理MySQL或PG连接
运维·mysql·nginx
FungLeo8 小时前
FengCMS · PHP+MySQL 升级实录· PHP Session 锁:什么时候释放能救活并发
android·mysql·php·session·fengcms
鹤落晴春1 天前
【MySQL】 | 两阶段提交、主从复制
运维·数据库·mysql
码少女1 天前
MySQL——复杂查询
数据库·mysql
codeejun1 天前
每日一Go·MySQL-20、SQL 性能调优实战总结
sql·mysql·golang
FungLeo1 天前
FengCMS · PHP+MySQL 升级实录 · 输出转义的度:面包屑双重编码、默认转义与 cms_html()信任声明
mysql·html·php·fengcms·输出转义
Escalating_xu1 天前
【MySQL】索引原理(上):从数据页到 B+ 树,弄懂聚簇索引、回表与覆盖索引
数据库·mysql