ソースコード


WITH Y AS (
	SELECT AGE_CODE, TIME_CODE, SUM(TARGET_POP) AS POP
	FROM SLEEP_TIME_DTL
	GROUP BY AGE_CODE, TIME_CODE
)

SELECT
	AGE_NAME AS 年齢階層
	, Y120.POP AS '5時間未満'
	, Y130.POP AS '5時間以上6時間未満'
	, Y140.POP AS '6時間以上7時間未満'
	, Y150.POP AS '7時間以上8時間未満'
	, Y160.POP AS '8時間以上9時間未満'
	, Y170.POP AS '9時間以上'
	, Y180.POP AS '不詳'
FROM AGE_GRP AS X
	LEFT OUTER JOIN Y AS Y120 ON X.AGE_CODE = Y120.AGE_CODE AND Y120.TIME_CODE = 120
	LEFT OUTER JOIN Y AS Y130 ON X.AGE_CODE = Y130.AGE_CODE AND Y130.TIME_CODE = 130
	LEFT OUTER JOIN Y AS Y140 ON X.AGE_CODE = Y140.AGE_CODE AND Y140.TIME_CODE = 140
	LEFT OUTER JOIN Y AS Y150 ON X.AGE_CODE = Y150.AGE_CODE AND Y150.TIME_CODE = 150
	LEFT OUTER JOIN Y AS Y160 ON X.AGE_CODE = Y160.AGE_CODE AND Y160.TIME_CODE = 160
	LEFT OUTER JOIN Y AS Y170 ON X.AGE_CODE = Y170.AGE_CODE AND Y170.TIME_CODE = 170
	LEFT OUTER JOIN Y AS Y180 ON X.AGE_CODE = Y180.AGE_CODE AND Y180.TIME_CODE = 180
ORDER BY X.AGE_CODE;


提出情報
提出日時2022/12/04 13:33:13
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者yowano
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
79 MB
データパターン2
WA
78 MB