ソースコード
select
    WEEK,
    AVG_CNT,
    case when length(AMT) > 6
         then substr(AMT,1,length(AMT)-6) || ',' || substr(AMT,length(AMT)-5,3) || ',' || substr(AMT,length(AMT)-2,3)
         when length(AMT) > 3
         then substr(AMT,1,length(AMT)-3) || ',' || substr(AMT,length(AMT)-2,3) else AMT
    end||'円' AS AVG_AMT
from(
select
    case week_num
        when '0' then '日'
        when '1' then '月'
        when '2' then '火'
        when '3' then '水'
        when '4' then '木'
        when '5' then '金'
        when '6' then '土'
    else '?' end AS WEEK,
    cast(round(avg(cnt),0) AS INT) AS AVG_CNT,
    cast(round(avg(day_sum_amt),0) AS INT) AS AMT
from (
        select strftime('%w', sales_date) as week_num,
                sum(sales_amt) as day_sum_amt,
                count(sales_no) as cnt
        from sales
        where updated_no is null and sales_type != 2
        and sales_date between '2024-03-01' AND '2024-03-28'
        group by sales_date
    )
group by week_num
order by week_num)
    
提出情報
提出日時2024/06/30 11:20:35
コンテスト第12回 SQLコンテスト
問題曜日別売上分析
受験者FighterOfTheWind
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
85 MB