All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g0601_0700.s0626_exchange_seats.script.sql Maven / Gradle / Ivy

There is a newer version: 1.37
Show newest version
# Write your MySQL query statement below
# #Medium #Database
select
    id,
    case when id % 2 = 1 and lead(student) over (order by id) is null then student 
         when id % 2 = 1 then lead(student) over (order by id)
         else lag(student) over (order by id)
    end as student
from seat
order by id asc




© 2015 - 2024 Weber Informatics LLC | Privacy Policy