ソースコード
SELECT
  t1.CLASS_NAME AS CLASS,
  t2.PERSON_NAME AS PERSON,
  t1.AMT AS HOUSEHOLDS
FROM
  (SELECT
     CLASS_CODE,
     CLASS_NAME,
     PERSON_CODE,
     PERSON_NAME,
     AMT,
     ROW_NUMBER() OVER (PARTITION BY CLASS_CODE ORDER BY AMT DESC) AS rn
   FROM
     HOUSEHOLD_AGGREGATE
   WHERE
     PERSON_CODE != '1' AND CLASS_CODE != '01'
  ) t1
INNER JOIN
  (SELECT
     CLASS_CODE,
     PERSON_NAME,
     AMT
   FROM
     HOUSEHOLD_AGGREGATE
   WHERE
     PERSON_CODE != '1' AND CLASS_CODE != '01'
  ) t2
ON t1.CLASS_CODE = t2.CLASS_CODE AND t1.rn = 1
ORDER BY
  t1.CLASS_CODE ASC;
提出情報
提出日時2023/07/20 16:09:51
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者megumilk-17
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量82 MB
メッセージ
SQLITE_ERROR: no such table: HOUSEHOLD_AGGREGATE
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
82 MB
データパターン2
RE
80 MB