ソースコード
SELECT 
    CLASS_NAME AS CLASS ,
    PERSON_NAME AS PERSON ,
    AMT AS HOUSEHOLDS
FROM
    HOUSEHOLD AS  HOUSEHOLD_1
    INNER JOIN (
                SELECT
                    CLASS_NAME AS CLASS_NAME_2 ,
                    PERSON_NAME AS PERSON_NAME_2 ,
                    MAX(AMT) AS MAX_AMT
                FROM 
                    HOUSEHOLD
                WHERE 
                    PERSON_CODE <> '1' AND 
                    CLASS_CODE <> '01'
                GROUP BY
                    CLASS_NAME
                ) AS  HOUSEHOLD_2
    ON 
        HOUSEHOLD_1.CLASS_NAME = HOUSEHOLD_2.CLASS_NAME_2 AND
        HOUSEHOLD_1.AMT = HOUSEHOLD_2.MAX_AMT
ORDER BY 
    CLASS_CODE
提出情報
提出日時2022/10/20 10:31:38
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者be-yan
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量101 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
101 MB
データパターン2
AC
99 MB