ソースコード
SELECT AGE.AGE_CODE  AS 年齢コード
      ,AGE.AGE_NAME  AS 年齢階層名
      ,DTL.SP_TIME_5 AS "5時間未満"
      ,DTL.SP_TIME_6 AS "5時間以上6時間未満"
      ,DTL.SP_TIME_7 AS "6時間以上7時間未満"
      ,DTL.SP_TIME_8 AS "7時間以上8時間未満"
      ,DTL.SP_TIME_9 AS "8時間以上9時間未満"
      ,DTL.SP_TIME_9OVER AS "9時間以上"
FROM (SELECT AGE_CODE
            ,SUM(SP_TIME_5) AS SP_TIME_5
            ,SUM(SP_TIME_6) AS SP_TIME_6
            ,SUM(SP_TIME_7) AS SP_TIME_7
            ,SUM(SP_TIME_8) AS SP_TIME_8
            ,SUM(SP_TIME_9) AS SP_TIME_9
            ,SUM(SP_TIME_9OVER) AS SP_TIME_9OVER
        FROM SLEEP_TIME_DTL SL
       INNER JOIN PREFECTURE PF
          ON SL.PF_CODE = PF.PF_CODE
       WHERE PF.PF_CODE = '01000'
          OR PF.PF_CODE = '02000'
          OR PF.PF_CODE = '03000'
          OR PF.PF_CODE = '04000'
          OR PF.PF_CODE = '07000'
       GROUP BY AGE_CODE
     ) AS DTL
INNER JOIN AGE_GRP AS AGE
   ON DTL.AGE_CODE = AGE.AGE_CODE
ORDER BY AGE.AGE_CODE
提出情報
提出日時2022/07/20 17:56:55
コンテスト第1回 SQLコンテスト
問題睡眠時間帯別集計
受験者yakiniku_tabetai_pakupaku
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量104 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
104 MB
データパターン2
AC
85 MB