ソースコード
select X.AGE_NAME as 年齢階層,A.TARGET_POP AS "5時間未満",B.TARGET_POP AS "5時間以上6時間未満", C.TARGET_POP AS "6時間以上7時間未満", D.TARGET_POP AS "7時間以上8時間未満", E.TARGET_POP AS "8時間以上9時間未満", F.TARGET_POP AS "9時間以上", G.TARGET_POP AS "不詳"
from AGE_GRP AS X
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=120 group by AGE_CODE) AS A on X.AGE_CODE=A.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=130 group by AGE_CODE) AS B on X.AGE_CODE=B.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=140 group by AGE_CODE) AS C on X.AGE_CODE=C.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=150 group by AGE_CODE) AS D on X.AGE_CODE=D.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=160 group by AGE_CODE) AS E on X.AGE_CODE=E.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=170 group by AGE_CODE) AS F on X.AGE_CODE=F.AGE_CODE
inner join (select AGE_CODE,SUM(TARGET_POP) AS TARGET_POP FROM SLEEP_TIME_DTL where TIME_CODE=180 group by AGE_CODE) AS G on X.AGE_CODE=G.AGE_CODE
order by X.AGE_CODE


提出情報
提出日時2023/02/19 15:49:05
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者TN
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
84 MB