コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT
t1.AGE_CODE AS '年齢階層',
t1.sum AS '5時間未満',
t2.sum AS '5時間以上6時間未満',
t3.sum AS '6時間以上7時間未満',
t4.sum AS '7時間以上8時間未満',
t5.sum AS '8時間以上9時間未満',
t6.sum AS '9時間以上',
t7.sum AS '不詳'
FROM (
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 120
GROUP BY AGE_CODE
) AS t1
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 130
GROUP BY AGE_CODE
) AS t2
ON t1.AGE_CODE = t2.AGE_CODE
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 140
GROUP BY AGE_CODE
) AS t3
ON t1.AGE_CODE = t3.AGE_CODE
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 150
GROUP BY AGE_CODE
) AS t4
ON t1.AGE_CODE = t4.AGE_CODE
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 160
GROUP BY AGE_CODE
) AS t5
ON t1.AGE_CODE = t5.AGE_CODE
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 170
GROUP BY AGE_CODE
) AS t6
ON t1.AGE_CODE = t6.AGE_CODE
INNER JOIN
(
SELECT AGE_CODE, SUM(TARGET_POP) AS sum
FROM SLEEP_TIME_DTL
WHERE TIME_CODE = 180
GROUP BY AGE_CODE
) AS t7
ON t1.AGE_CODE = t7.AGE_CODE
ORDER BY t1.AGE_CODE
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
87 MB