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
相关推荐
FungLeo9 小时前
FengCMS · PHP+MySQL 升级实录 · 旧后台备份三宗罪:漏空表、改写内容、按分号切 SQL 直接执行
sql·mysql·php·安全加固·fengcms
SA-D9 小时前
MySQL 性能分析与库存一致性:从 Buffer Pool、B+ 树到执行计划
数据库·mysql
djjjx.1 天前
Mysql数据库基础篇(八):详细讲解复合查询、多表查询、自连接、多行、多列子查询与合并查询
数据库·mysql
MSTcheng.1 天前
【MySQL】MySQL数据库——表的操作
数据库·mysql·adb
FungLeo1 天前
FengCMS · PHP+MySQL 升级实录 · 内容写入一致性:锁等待超时与跨模型子树删除竞态
开发语言·mysql·php·工程实践·fengcms
ZhengEnCi1 天前
覆盖索引是什么:用借书和外卖看懂回表这件事
sql·mysql·postgresql
鹤落晴春1 天前
MySQL日志梳理
运维·数据库·mysql
FungLeo1 天前
FengCMS · PHP+MySQL 升级实录 · MySQL DDL不能回滚:模型字段结构操作的失败续做
android·mysql·php·工程实践·fengcms
隔窗听雨眠1 天前
MySQL锁等待的定位方法与治理体系
mysql·锁机制·数据库运维
千寻技术帮1 天前
基于Spring Boot+Vue的农产品销售管理系统(源码+文档+数据库,附部署教程)
java·数据库·spring boot·后端·mysql·vue