ソースコード
-- SELECT CLASS_NAME as CLASS, PERSON_NAME as PERSON, MAX(AMT) as HOUSEHOLDS
-- FROM HOUSEHOLD
-- GROUP BY CLASS_NAME, PERSON_NAME
-- HAVING PERSON_CODE <> 1 and CLASS_CODE <> "01"
-- ORDER BY CLASS_CODE

SELECT CLASS_NAME as CLASS, PERSON_NAME as PERSON, AMT as HOUSEHOLDS
FROM HOUSEHOLD as H
WHERE AMT = (SELECT MAX(AMT) as HOUSEHOLDS FROM HOUSEHOLD  WHERE CLASS_NAME = H.CLASS_NAME and PERSON_CODE <> 1 and CLASS_CODE <> "01")
GROUP BY CLASS_NAME, PERSON_NAME
HAVING PERSON_CODE <> 1 and CLASS_CODE <> "01"
ORDER BY CLASS_CODE
提出情報
提出日時2022/10/19 19:38:08
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者seiya592
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量92 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
92 MB
データパターン2
AC
92 MB