ソースコード
WITH
    H2 AS (
        SELECT
            CLASS_NAME AS CLASS,
            PERSON_NAME AS PERSON,
            SUM(AMT) AS HOUSEHOLDS
        FROM
            HOUSEHOLD
        WHERE
            CLASS_CODE <> '01'
            AND PERSON_CODE <> '1'
        GROUP BY
            CLASS_NAME,
            PERSON_NAME
    ),
    MaxHouseholds AS (
        SELECT
            CLASS,
            MAX(HOUSEHOLDS) AS MaxHouseholds
        FROM
            H2
        GROUP BY
            CLASS
    )
SELECT
    H2.CLASS,
    H2.PERSON,
    H2.HOUSEHOLDS
FROM
    H2
    JOIN MaxHouseholds mh ON H2.CLASS = mh.CLASS
    AND H2.HOUSEHOLDS = mh.MaxHouseholds
ORDER BY
    CLASS_CODE;
提出情報
提出日時2024/07/13 10:23:50
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者hassy
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量85 MB
メッセージ
SQLITE_ERROR: no such column: CLASS_CODE
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
85 MB
データパターン2
RE
85 MB