ソースコード
WITH t1 AS (SELECT lo.SESSION_ID, lo.PROCESS_ID, lo.EX_TIMESTAMP, MAX(lo2.EX_TIMESTAMP) pre_t
            FROM PROCESS_LOG lo
                 LEFT JOIN PROCESS_LOG lo2 ON lo.SESSION_ID = lo2.SESSION_ID AND lo.EX_TIMESTAMP > lo2.EX_TIMESTAMP
            GROUP BY lo.SESSION_ID, lo.PROCESS_ID,lo.EX_TIMESTAMP)
   , t2 AS (SELECT t1.*, 1 step
            FROM t1
            WHERE PROCESS_ID = 'STEP1'
              AND pre_t IS NULL
            UNION ALL
            SELECT t1.*, t2.step + 1
            FROM t1
                 JOIN t2 ON t1.SESSION_ID = t2.SESSION_ID AND t1.PROCESS_ID = 'STEP' || (t2.step + 1) AND t1.pre_t = t2.EX_TIMESTAMP
            WHERE step < 5)
--
SELECT process_id PROCESS, COUNT(distinct SESSION_ID) CNT
FROM t2
GROUP BY process_id
ORDER BY 1
提出情報
提出日時2024/06/16 04:27:48
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者pp1mqa6hkm
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
85 MB
データパターン3
AC
86 MB
データパターン4
WA
84 MB