コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT
AGE_NAME AS 年齢階層,
COALESCE(A.X, 0) AS '5時間未満',
COALESCE(B.X, 0) AS '5時間以上6時間未満',
COALESCE(C.X, 0) AS '6時間以上7時間未満',
COALESCE(D.X, 0) AS '7時間以上8時間未満',
COALESCE(E.X, 0) AS '8時間以上9時間未満',
COALESCE(F.X, 0) AS '9時間以上',
COALESCE(G.X, 0) AS '不詳'
FROM AGE_GRP
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=120 GROUP BY AGE_CODE) AS A USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=130 GROUP BY AGE_CODE) AS B USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=140 GROUP BY AGE_CODE) AS C USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=150 GROUP BY AGE_CODE) AS D USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=160 GROUP BY AGE_CODE) AS E USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=170 GROUP BY AGE_CODE) AS F USING(AGE_CODE)
LEFT JOIN (SELECT SUM(TARGET_POP) AS X, AGE_CODE FROM SLEEP_TIME_DTL
WHERE TIME_CODE=180 GROUP BY AGE_CODE) AS G USING(AGE_CODE)
WHERE A.X IS NOT NULL
OR B.X IS NOT NULL
OR C.X IS NOT NULL
OR D.X IS NOT NULL
OR E.X IS NOT NULL
OR F.X IS NOT NULL
OR G.X IS NOT NULL
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
78 MB