ソースコード
SELECT
AG.AGE_NAME AS "年齢階層",
STD120.cnt AS "5時間未満",
STD130.cnt AS "5時間以上6時間未満",
STD140.cnt AS "6時間以上7時間未満",
STD150.cnt AS "7時間以上8時間未満",
STD160.cnt AS "8時間以上9時間未満",
STD170.cnt AS "9時間以上",
STD180.cnt AS "不詳"
FROM AGE_GRP AS AG
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 120 
GROUP BY AGE_CODE)
AS STD120
ON AG.AGE_CODE = STD120.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 130 
GROUP BY AGE_CODE)
AS STD130
ON AG.AGE_CODE = STD130.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 140 
GROUP BY AGE_CODE)
AS STD140
ON AG.AGE_CODE = STD140.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 150 
GROUP BY AGE_CODE)
AS STD150
ON AG.AGE_CODE = STD150.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 160 
GROUP BY AGE_CODE)
AS STD160
ON AG.AGE_CODE = STD160.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 170 
GROUP BY AGE_CODE)
AS STD170
ON AG.AGE_CODE = STD170.AGE_CODE
INNER JOIN 
(SELECT AGE_CODE, SUM(TARGET_POP) AS cnt FROM SLEEP_TIME_DTL 
WHERE TIME_CODE = 180 
GROUP BY AGE_CODE)
AS STD180
ON AG.AGE_CODE = STD180.AGE_CODE
ORDER BY AG.AGE_CODE
;
提出情報
提出日時2022/08/29 22:34:44
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者fujiringo
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
79 MB
データパターン2
AC
77 MB