ソースコード
with aaa as (
select
  *
 ,LAG (NEW_MRR, 1, 0) OVER (ORDER BY MONTHLY) AS LAG_NEW_MRR
 ,LAG (EXPANSION_MRR, 1, 0) OVER (ORDER BY MONTHLY) AS LAG_EXPANSION_MRR
 ,LAG (DOWNGRADE_MRR, 1, 0) OVER (ORDER BY MONTHLY) AS LAG_DOWNGRADE_MRR
 ,LAG (CHURN_MRR, 1, 0) OVER (ORDER BY MONTHLY) AS LAG_CHURN_MRR
from MRR_DATA
)
, bbb as (
  select
  *, LAG_NEW_MRR+LAG_EXPANSION_MRR-LAG_DOWNGRADE_MRR-LAG_CHURN_MRR as aaa
  from
  aaa
)
select
  MONTHLY as YM
,SUM(aaa) OVER (
    ORDER BY
      MONTHLY ASC
  ) AS MRR
from bbb
order by MONTHLY
提出情報
提出日時2023/02/19 16:01:50
コンテスト第5回 SQLコンテスト
問題MRRの集計
受験者kon-kitsune
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量87 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
87 MB
データパターン2
WA
80 MB
データパターン3
WA
86 MB