ソースコード
SELECT 
	b.AGE_NAME as 年齢階層,
	a4.CNT as "5時間未満",
	a5.CNT as "5時間以上6時間未満",
	a6.CNT as "6時間以上7時間未満",
	a7.CNT as "7時間以上8時間未満",
	a8.CNT as "8時間以上9時間未満",
	a9.CNT as "9時間以上",
	a0.CNT as 不詳
FROM
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 120
	GROUP BY AGE_CODE
	) a4,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 130
	GROUP BY AGE_CODE
	) a5,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 140
	GROUP BY AGE_CODE
	) a6,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 150
	GROUP BY AGE_CODE
	) a7,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 160
	GROUP BY AGE_CODE
	) a8,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 170
	GROUP BY AGE_CODE
	) a9,
	(SELECT
		AGE_CODE,
		sum(TARGET_POP) as CNT
	FROM SLEEP_TIME_DTL
	WHERE TIME_CODE = 180
	GROUP BY AGE_CODE
	) a0,
	AGE_GRP b
WHERE
	a4.AGE_CODE = a5.AGE_CODE AND
	a5.AGE_CODE = a6.AGE_CODE AND
	a6.AGE_CODE = a7.AGE_CODE AND
	a7.AGE_CODE = a8.AGE_CODE AND
	a8.AGE_CODE = a9.AGE_CODE AND
	a9.AGE_CODE = a0.AGE_CODE AND
	a0.AGE_CODE = b.AGE_CODE
ORDER BY
	b.AGE_CODE ASC
提出情報
提出日時2022/07/20 15:43:47
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者ks2m
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
94 MB
データパターン2
AC
92 MB