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