ソースコード
Create temporary view dtl as
select
    age_code,
    sum(case when time_code=120 then TARGET_POP else 0 end) as tc120,
    sum(case when time_code=130 then TARGET_POP else 0 end) as tc130,
    sum(case when time_code=140 then TARGET_POP else 0 end) as tc140,
    sum(case when time_code=150 then TARGET_POP else 0 end) as tc150,
    sum(case when time_code=160 then TARGET_POP else 0 end) as tc160,
    sum(case when time_code=170 then TARGET_POP else 0 end) as tc170,
    sum(case when time_code=180 then TARGET_POP else 0 end) as tc180
from
    SLEEP_TIME_DTL
group by age_code;

select
    a.AGE_NAME as "年齢階層",
    dtl.tc120 as "5時間未満",
    dtl.tc130 as "5時間以上6時間未満",
    dtl.tc140 as "6時間以上7時間未満",
    dtl.tc150 as "7時間以上8時間未満",
    dtl.tc160 as "8時間以上9時間未満",
    dtl.tc170 as "9時間以上",
    dtl.tc180 as "不詳"
from
    AGE_GRP as a
    inner join
    dtl
    on a.AGE_CODE = dtl.AGE_CODE
order by 
    a.AGE_CODE
提出情報
提出日時2024/03/07 17:42:48
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者gP2fWnUzTL
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
83 MB