コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT PROCESS_ID AS PROCESS,
SUM(CNT) AS CNT
FROM (SELECT SESSION_ID,
PROCESS_ID,
USER_ID,
EX_TIMESTAMP,
CASE
WHEN PROCESS_ID = 'STEP5' AND LAG(PROCESS_ID, 1) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP4' AND LAG(PROCESS_ID, 2) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP3' AND LAG(PROCESS_ID, 3) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP2' AND LAG(PROCESS_ID, 4) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP1' THEN '1'
WHEN PROCESS_ID = 'STEP4' AND LAG(PROCESS_ID, 1) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP3' AND LAG(PROCESS_ID, 2) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP2' AND LAG(PROCESS_ID, 3) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP1' THEN '1'
WHEN PROCESS_ID = 'STEP3' AND LAG(PROCESS_ID, 1) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP2' AND LAG(PROCESS_ID, 2) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP1' THEN '1'
WHEN PROCESS_ID = 'STEP2' AND LAG(PROCESS_ID, 1) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) = 'STEP1' THEN '1'
WHEN PROCESS_ID = 'STEP1' AND LAG(PROCESS_ID, 1) over (PARTITION BY SESSION_ID, USER_ID ORDER BY EX_TIMESTAMP) IS NULL THEN '1'
ELSE '0'
END AS CNT
FROM PROCESS_LOG
)
GROUP BY PROCESS_ID
ORDER BY PROCESS_ID
提出情報
提出日時 | 2023/12/19 17:16:42 |
コンテスト | 第10回 SQLコンテスト |
問題 | 顧客行動分析 |
受験者 | test |
状態 (詳細) | WA (Wrong Answer: 誤答) |
メモリ使用量 | 86 MB |
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
84 MB
データパターン3
WA
84 MB
データパターン4
AC
86 MB