ソースコード
SELECT
STD_SUM.AGE_CODE AS "年齢コード",
AG.AGE_NAME AS "年齢階層名",
STD_SUM.sum5 AS "5時間未満",
STD_SUM.sum6 AS "5時間以上6時間未満",
STD_SUM.sum7 AS "6時間以上7時間未満",
STD_SUM.sum8 AS "7時間以上8時間未満",
STD_SUM.sum9 AS "8時間以上9時間未満",
STD_SUM.sum9o AS "9時間以上"
FROM
(SELECT 
AGE_CODE,
SUM(SP_TIME_5) AS sum5,
SUM(SP_TIME_6) AS sum6,
SUM(SP_TIME_7) AS sum7,
SUM(SP_TIME_8) AS sum8,
SUM(SP_TIME_9) AS sum9,
SUM(SP_TIME_9OVER) AS sum9o
FROM SLEEP_TIME_DTL
WHERE PF_CODE IN ('01000', '02000', '03000', '04000', '07000')
GROUP BY AGE_CODE
)
AS STD_SUM
INNER JOIN AGE_GRP AS AG
ON STD_SUM.AGE_CODE = AG.AGE_CODE 
ORDER BY "年齢コード"
;
提出情報
提出日時2022/08/30 09:06:46
コンテスト第1回 SQLコンテスト
問題睡眠時間帯別集計
受験者fujiringo
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
77 MB
データパターン2
AC
76 MB