ソースコード
SELECT  p1.PROCESS_ID AS PROCESS,
        COUNT(p2.SESSION_ID) AS CNT
FROM  PROCESS_LOG p1
LEFT JOIN ( SELECT  SESSION_ID,
                    PROCESS_ID,
                    USER_ID,
                    STEPOUT,
                    COUNT,
                    COUNT(PROCESS_ID) OVER(partition by SESSION_ID order by EX_TIMESTAMP) AS COUNT2
            FROM    (
                        SELECT  SESSION_ID,
                                PROCESS_ID,
                                USER_ID,
                                EX_TIMESTAMP,
                                SUBSTR(PROCESS_ID, 5, 1) AS STEPOUT,
                                COUNT(PROCESS_ID) OVER(partition by SESSION_ID order by EX_TIMESTAMP) AS COUNT
                        FROM    PROCESS_LOG
                    ) 
            WHERE   CAST(COUNT as string) = CAST(STEPOUT AS string)
        )p2 
  ON p1.PROCESS_ID = p2.PROCESS_ID
 AND p1.SESSION_ID = p2.SESSION_ID
WHERE p2.COUNT = p2.COUNT2
GROUP BY p1.PROCESS_ID
ORDER BY p1.PROCESS_ID ASC
提出情報
提出日時2023/12/21 11:32:05
コンテスト第10回 SQLコンテスト
問題顧客行動分析
受験者test
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
84 MB
データパターン3
AC
86 MB
データパターン4
WA
84 MB