ソースコード
SELECT 
    PROCESS_ID AS PROCESS, 
    COUNT(DISTINCT SESSION_ID) AS CNT
FROM 
    (
        SELECT 
            SESSION_ID, 
            PROCESS_ID, 
            LEAD(PROCESS_ID) OVER (PARTITION BY SESSION_ID ORDER BY EX_TIMESTAMP) AS NEXT_STEP
        FROM 
            PROCESS_LOG
    ) AS SessionSteps
WHERE 
    (PROCESS_ID = 'STEP1' AND (NEXT_STEP = 'STEP2' OR NEXT_STEP IS NULL))
    OR (PROCESS_ID = 'STEP2' AND (NEXT_STEP = 'STEP3' OR NEXT_STEP IS NULL))
    OR (PROCESS_ID = 'STEP3' AND (NEXT_STEP = 'STEP4' OR NEXT_STEP IS NULL))
    OR (PROCESS_ID = 'STEP4' AND (NEXT_STEP = 'STEP5' OR NEXT_STEP IS NULL))
    OR (PROCESS_ID = 'STEP5' AND NEXT_STEP IS NULL)
GROUP BY 
    PROCESS_ID
ORDER BY 
    PROCESS_ID;
提出情報
提出日時2023/12/17 23:18:22
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者sql_yowayowa
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量90 MB
メッセージ
テストケース(通過数/総数)
0/4
状態
メモリ使用量
データパターン1
WA
86 MB
データパターン2
WA
90 MB
データパターン3
WA
87 MB
データパターン4
WA
85 MB