ソースコード
with table_row as(
select *,
ROW_NUMBER() over(ORDER BY 1,2) as num
from SEAT_RESERVE
),
table_row2 as(
select r1.*,
r1.RSV_STATUS+r2.RSV_STATUS as row2
from table_row r1 left join table_row r2 on r1.num+1 = r2.num
where r1.SEAT_NO <= 14
),
table_row3 as(
select r2.*,
r2.row2+r1.RSV_STATUS as row3
from table_row2 r2 left join table_row r1 on r2.num+2=r1.num
where r2.SEAT_NO <= 13
)
select
LINE_ID as LINE,
SEAT_NO as SEAT_F,
SEAT_NO +2 as SEAT_T
from table_row3
where row3 = 0
order by 1 desc, 2
提出情報
提出日時2024/06/23 16:57:20
コンテスト第13回 SQLコンテスト
問題空席検索
受験者nagisa5101
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量91 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
91 MB
データパターン2
AC
84 MB
データパターン3
AC
84 MB