ソースコード
select ag.AGE_NAME 年齢階層,
s1.a as '5時間未満', 
s2.a as '5時間以上6時間未満', 
s3.a as '6時間以上7時間未満', 
s4.a as '7時間以上8時間未満', 
s5.a as '8時間以上9時間未満', 
s6.a as '9時間以上', 
s7.a as '不詳'
from AGE_GRP  ag 
inner join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 120 group by age_code) s1 on 
 (s1.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 130 group by age_code) s2 on 
 (s2.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 140 group by age_code) s3 on 
 (s3.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 150 group by age_code) s4 on 
 (s4.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 160 group by age_code) s5 on 
 (s5.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 170 group by age_code) s6 on 
 (s6.AGE_CODE = ag.AGE_CODE)
left outer join (select age_code,sum(target_pop) a from SLEEP_TIME_DTL where TIME_CODE = 180 group by age_code) s7 on 
 (s7.AGE_CODE = ag.AGE_CODE)
提出情報
提出日時2022/09/19 17:36:17
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者piro
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量81 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
81 MB