ソースコード
select
YM as YM
,sum(mrr) over(order by YM) as MRR
from(
    select
    monthly as YM
    ,strftime(DATE(monthly,'localtime','+1 MONTH')) as prev2
    ,ifnull(prev_new_mrr+prev_expansion_mrr-prev_downgrade_mrr-prev_churn_mrr,0) as MRR
            ,new_mrr as prev_new_mrr
        ,expansion_mrr as prev_expansion_mrr
        ,downgrade_mrr as prev_downgrade_mrr
        ,churn_mrr as prev_churn_mrr
    from mrr_data as m1
    left outer join(
        select
        strftime(DATE(monthly,'localtime','+1 MONTH')) as prev
        ,new_mrr as prev_new_mrr
        ,expansion_mrr as prev_expansion_mrr
        ,downgrade_mrr as prev_downgrade_mrr
        ,churn_mrr as prev_churn_mrr
        from mrr_data
    ) as m2
    on m1.monthly = m2.prev
)as m0
order by YM
提出情報
提出日時2024/05/17 11:31:10
コンテスト第5回 SQLコンテスト
問題MRRの集計
受験者HamamatsuUnagi
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
83 MB
データパターン3
WA
82 MB