ソースコード
SELECT CLASS,PERSON,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:36:02
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者Clover
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量111 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
99 MB
データパターン2
AC
111 MB