コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
with step1 as (
select PROCESS_ID, SESSION_ID,EX_TIMESTAMP
from PROCESS_LOG main
where PROCESS_ID = 'STEP1'
and not exists (select * from PROCESS_LOG where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP)
),
step2 as (
select PROCESS_ID, SESSION_ID,EX_TIMESTAMP
from PROCESS_LOG main
where PROCESS_ID = 'STEP2'
and exists ( select * from step1 where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP)
and not exists ( select * from PROCESS_LOG where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP and PROCESS_ID in ('STEP3','STEP4','STEP5'))
),
step3 as (
select PROCESS_ID, SESSION_ID,EX_TIMESTAMP
from PROCESS_LOG main
where PROCESS_ID = 'STEP3'
and exists ( select * from step2 where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP)
and not exists ( select * from PROCESS_LOG where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP and PROCESS_ID in ('STEP4','STEP5'))
),
step4 as (
select PROCESS_ID, SESSION_ID,EX_TIMESTAMP
from PROCESS_LOG main
where PROCESS_ID = 'STEP4'
and exists ( select * from step3 where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP)
and not exists ( select * from PROCESS_LOG where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP and PROCESS_ID in ('STEP5'))
),
step5 as (
select PROCESS_ID, SESSION_ID,EX_TIMESTAMP
from PROCESS_LOG main
where PROCESS_ID = 'STEP5'
and exists ( select * from step4 where SESSION_ID = main.SESSION_ID and EX_TIMESTAMP < main.EX_TIMESTAMP)
)
select 'STEP1' as PROCESS, count(1) as CNT from step1
union all
select 'STEP2', count(1) from step2
union all
select 'STEP3', count(1) from step3
union all
select 'STEP4', count(1) from step4
union all
select 'STEP5', count(1) from step5
;
提出情報
提出日時 | 2024/04/28 18:14:00 |
コンテスト | 第10回 SQLコンテスト |
問題 | 顧客行動分析 |
受験者 | yunyun8686 |
状態 (詳細) | AC (Accepted: 正答) |
メモリ使用量 | 85 MB |
メッセージ
テストケース(通過数/総数)
4/4
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
85 MB
データパターン3
AC
85 MB
データパターン4
AC
84 MB