ソースコード
select AGE_NAME as 年齢階層,
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 120) as '5時間未満',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 130) as '5時間以上6時間未満',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 140) as '6時間以上7時間未満',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 150) as '7時間以上8時間未満',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 160) as '8時間以上9時間未満',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 170) as '9時間以上',
(select sum(TARGET_POP) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE and TIME_CODE = 180) as '不詳'
from AGE_GRP
where (select count(0) from SLEEP_TIME_DTL where SLEEP_TIME_DTL.AGE_CODE = AGE_GRP.AGE_CODE) > 0
order by AGE_CODE asc;
提出情報
提出日時2022/07/20 21:40:47
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者kobae964
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量105 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
105 MB
データパターン2
AC
53 MB