ソースコード
with z as (
    select age_name, time_name, sum(target_pop) as p,a.age_code
    from SLEEP_TIME_DTL as s inner join
    AGE_GRP as a on s.age_code=a.age_code inner join
    SLEEP_TIME as t on s.time_code=t.time_code
    group by 1,2
)
select age_name,
sum(case when time_name="5時間未満" then p else 0 end) as "5時間未満",
sum(case when time_name="5時間以上6時間未満" then p else 0 end) as "5時間以上6時間未満",
sum(case when time_name="6時間以上7時間未満" then p else 0 end) as "6時間以上7時間未満",
sum(case when time_name="7時間以上8時間未満" then p else 0 end) as "7時間以上8時間未満",
sum(case when time_name="8時間以上9時間未満" then p else 0 end) as "8時間以上9時間未満",
sum(case when time_name="9時間以上" then p else 0 end) as "9時間以上",
sum(case when time_name="不詳" then p else 0 end) as "不詳"
from z
group by age_name
order by age_code
提出情報
提出日時2023/04/13 23:51:16
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者tabr
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
78 MB
データパターン2
WA
79 MB