ソースコード
with a as (
select 
a.age_name,
a.age_code,
case s2.time_code when 120 then s2.target_pop else null end as tc120,
case s2.time_code when 130 then s2.target_pop else null end as tc130,
case s2.time_code when 140 then s2.target_pop else null end as tc140,
case s2.time_code when 150 then s2.target_pop else null end as tc150,
case s2.time_code when 160 then s2.target_pop else null end as tc160,
case s2.time_code when 170 then s2.target_pop else null end as tc170,
case s2.time_code when 180 then s2.target_pop else null end as tc180
from 
AGE_GRP a,
SLEEP_TIME s1,
SLEEP_TIME_DTL s2
where
a.age_code = s2.age_code
and s1.time_code = s2.time_code)
select
age_name as '年齢階層',
sum(tc120) as '5時間未満',
sum(tc130) as '5時間以上6時間未満',
sum(tc140) as '6時間以上7時間未満',
sum(tc150) as '7時間以上8時間未満',
sum(tc160) as '8時間以上9時間未満',
sum(tc170) as '9時間以上',
sum(tc180) as '不詳'
from a
group by 1
order by age_code



提出情報
提出日時2022/09/17 22:40:05
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者KT04
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
79 MB
データパターン2
AC
76 MB