ソースコード
with cte as (
select distinct
    SESSION_ID
    ,PROCESS_ID
    ,EX_TIMESTAMP
from
    PROCESS_LOG
)
,base as (
select
    SESSION_ID
    ,cast(replace(PROCESS_ID,"STEP","") as int) as PROCESS_ID
    ,row_number() over (partition by SESSION_ID order by EX_TIMESTAMP) as PR_ORDER
    ,EX_TIMESTAMP
from
    cte
)
,base2 as (
select
    SESSION_ID
    ,PROCESS_ID
    ,EX_TIMESTAMP
    ,row_number() over (partition by SESSION_ID order by EX_TIMESTAMP) as PR_ORDER2
from
    base
where
    PROCESS_ID = PR_ORDER
)
select
    "STEP"||PROCESS_ID as PROCESS
    ,count(distinct SESSION_ID) as CNT
from
    base2
where
    PROCESS_ID = PR_ORDER2
group by 
    PROCESS_ID
order by
    PROCESS_ID
提出情報
提出日時2024/03/14 15:37:09
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者gP2fWnUzTL
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
82 MB
データパターン2
AC
84 MB
データパターン3
AC
84 MB
データパターン4
WA
83 MB