ソースコード
with r as (
select *, rank() over(partition by session_id order by EX_TIMESTAMP) as ra
from process_log
)
, r2 as (
select * from r
where ra == cast(substr(process_id, 5) as integer)
)
, r3 as (select * 
, (select count(1) from r2 b where b.ra < a.ra and b.session_id = a.session_id) as cnt
from r2 as a
)
, ss as (
select 'STEP1' as PROCESS union all
select 'STEP2' union all
select 'STEP3' union all
select 'STEP4' union all
select 'STEP5'
)
select 
ss.PROCESS as PROCESS
, ifnull(count(1), 0) as CNT
from ss left join r3 on ss.PROCESS = r3.process_id
where ra - 1 = cnt
group by process_id
order by PROCESS
提出情報
提出日時2024/05/03 21:36:59
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者daku10
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
84 MB
データパターン3
AC
86 MB
データパターン4
WA
84 MB