コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT
AG.AGE_NAME AS '年齢階層'
,STD120.TP AS '5時間未満'
,STD130.TP AS '5時間以上6時間未満'
,STD140.TP AS '6時間以上7時間未満'
,STD150.TP AS '7時間以上8時間未満'
,STD160.TP AS '8時間以上9時間未満'
,STD170.TP AS '9時間以上'
,STD180.TP AS '不詳'
FROM
(
SELECT
AGE_CODE
FROM
SLEEP_TIME_DTL
GROUP BY
AGE_CODE
) AS STD
LEFT OUTER JOIN
AGE_GRP AS AG
ON
AG.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 120
GROUP BY
AGE_CODE
) AS STD120
ON
STD120.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 130
GROUP BY
AGE_CODE
) AS STD130
ON
STD130.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 140
GROUP BY
AGE_CODE
) AS STD140
ON
STD140.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 150
GROUP BY
AGE_CODE
) AS STD150
ON
STD150.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 160
GROUP BY
AGE_CODE
) AS STD160
ON
STD160.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 170
GROUP BY
AGE_CODE
) AS STD170
ON
STD170.AGE_CODE = STD.AGE_CODE
LEFT OUTER JOIN
(
SELECT
AGE_CODE
,SUM(TARGET_POP) AS TP
FROM
SLEEP_TIME_DTL
WHERE
TIME_CODE = 180
GROUP BY
AGE_CODE
) AS STD180
ON
STD180.AGE_CODE = STD.AGE_CODE
ORDER BY
STD.AGE_CODE ASC
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
93 MB
データパターン2
AC
84 MB