ソースコード
with diff as (
    select mrr.monthly, coalesce(last.new_mrr, 0) + coalesce(last.expansion_mrr, 0) + coalesce(last.downgrade_mrr, 0) + coalesce(last.churn_mrr, 0) as value
    from mrr_data as mrr
    left join mrr_data as last
    on date(mrr.monthly, '-1 month') = last.monthly
)
select diff.monthly as YM, sum(diff2.value) as MRR
from diff
left join diff as diff2
on diff.monthly >= diff2.monthly
group by diff.monthly
order by diff.monthly asc
提出情報
提出日時2023/02/20 11:31:14
コンテスト第5回 SQLコンテスト
問題MRRの集計
受験者kkkkk
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量97 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
80 MB
データパターン2
WA
97 MB
データパターン3
WA
79 MB