ソースコード
SELECT CLASS,CLASS_CODE,HOUSEHOLDS FROM (
SELECT DISTINCT CLASS_NAME AS CLASS,CLASS_CODE, PERSON_NAME AS PERSON,MAX(AMT) AS HOUSEHOLDS FROM HOUSEHOLD WHERE NOT(PERSON_CODE = '1') AND CLASS_CODE = '12'
UNION
SELECT DISTINCT CLASS_NAME AS CLASS,CLASS_CODE, PERSON_NAME AS PERSON,MAX(AMT) AS HOUSEHOLDS FROM HOUSEHOLD WHERE NOT(PERSON_CODE = '1') AND CLASS_CODE = '13'
UNION
SELECT DISTINCT CLASS_NAME AS CLASS,CLASS_CODE, PERSON_NAME AS PERSON,MAX(AMT) AS HOUSEHOLDS FROM HOUSEHOLD WHERE NOT(PERSON_CODE = '1') AND CLASS_CODE = '14'
UNION
SELECT DISTINCT CLASS_NAME AS CLASS,CLASS_CODE, PERSON_NAME AS PERSON,MAX(AMT) AS HOUSEHOLDS FROM HOUSEHOLD WHERE NOT(PERSON_CODE = '1') AND CLASS_CODE = '15'
UNION
SELECT DISTINCT CLASS_NAME AS CLASS,CLASS_CODE, PERSON_NAME AS PERSON,MAX(AMT) AS HOUSEHOLDS FROM HOUSEHOLD WHERE NOT(PERSON_CODE = '1') AND CLASS_CODE = '16'
)
ORDER BY CLASS_CODE
提出情報
提出日時2022/10/20 00:34:32
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者Clover
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量111 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
111 MB
データパターン2
WA
96 MB