ソースコード
with subq as (
select *
    ,cast(substr(process_id,5,1) as int) step
    ,rank() over (partition by session_id,user_id order by ex_timestamp) as row
from process_log
)

,subq2 as(--アウトなやつらの後ろ

select distinct a.*
from process_log as a
inner join subq
on step <> row
and a.session_id = subq.session_id
and a.process_id > subq.process_id
)

select subq.process_id as PROCESS
        ,count(subq.process_id) as CNT

from subq
left outer join subq2
on subq.session_id = subq2.session_id
and subq.process_id = subq2.process_id
and subq.user_id = subq2.user_id
and subq.ex_timestamp = subq2.ex_timestamp
where step = row
and subq2.session_id is null
group by subq.process_id
order by PROCESS
提出情報
提出日時2024/02/17 22:44:03
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者asterect
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
84 MB
データパターン3
AC
86 MB
データパターン4
WA
84 MB