ソースコード
select
    AGE_GRP.AGE_NAME as "年齢階層",
    t120.s as "5時間未満",
    t130.s as "5時間以上6時間未満",
    t140.s as "6時間以上7時間未満",
    t150.s as "7時間以上8時間未満",
    t160.s as "8時間以上9時間未満",
    t170.s as "9時間以上",
    t180.s as "不詳"
from
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 120
        group by
            AGE_CODE
    ) as t120,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 130
        group by
            AGE_CODE
    ) as t130,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 140
        group by
            AGE_CODE
    ) as t140,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 150
        group by
            AGE_CODE
    ) as t150,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 160
        group by
            AGE_CODE
    ) as t160,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 170
        group by
            AGE_CODE
    ) as t170,
    (
        select
            AGE_CODE,
            sum(TARGET_POP) as s
        from
            SLEEP_TIME_DTL
        where
            TIME_CODE == 180
        group by
            AGE_CODE
    ) as t180,
    AGE_GRP
where
    AGE_GRP.AGE_CODE == t120.AGE_CODE
    and AGE_GRP.AGE_CODE == t130.AGE_CODE
    and AGE_GRP.AGE_CODE == t140.AGE_CODE
    and AGE_GRP.AGE_CODE == t150.AGE_CODE
    and AGE_GRP.AGE_CODE == t160.AGE_CODE
    and AGE_GRP.AGE_CODE == t170.AGE_CODE
    and AGE_GRP.AGE_CODE == t180.AGE_CODE
order by
    AGE_GRP.AGE_CODE
提出情報
提出日時2024/02/16 05:06:25
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者shogo314
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量88 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
88 MB
データパターン2
AC
85 MB