# [626. Exchange Seats](https://leetcode.com/problems/exchange-seats/description/?envType=study-plan-v2&envId=top-sql-50)   這一次我們要將id奇變偶 所以用到了新函數 ROW_NUMBER() 查詢出來的每一列資料加上一個序號 ```SQL SELECT ROW_NUMBER() OVER() id, student FROM seat ORDER BY IF(MOD(id, 2) = 0, id-1, id+1) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up