Skip to content

Commit aca34cd

Browse files
committed
🟡 Solve problem 626
1 parent eeb4448 commit aca34cd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎sql/626.sql

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SELECT
2+
CASE
3+
WHEN MOD(id, 2) = 1 AND id + 1 <= (SELECT MAX(id) FROM Seat) THEN id + 1
4+
WHEN MOD(id, 2) = 0 THEN id - 1
5+
ELSE id
6+
END AS id,
7+
student
8+
FROM Seat
9+
ORDER BY id ASC;

0 commit comments

Comments
 (0)