ソースコード
select CLASS_NAME as CLASS, PERSON_NAME as PERSON, max(AMT) as HOUSEHOLDS
from HOUSEHOLD
where PERSON_CODE != '1'
and CLASS_CODE != '01'

SELECT
  t2.CLASS_NAME
  , t2.PERSON_NAME
  , t2.AMT
FROM
  HOUSEHOLD t2
  INNER JOIN (
              SELECT
                CLASS_CODE
                ,PERSON_CODE
                , MAX(AMT) AS MAX_AMT
              FROM
                HOUSEHOLD t1
              where PERSON_CODE != '1'
                and CLASS_CODE != '01'
              GROUP BY
                CLASS_CODE
             ) t1
          ON t1.CLASS_CODE = t2.CLASS_CODE
         AND t1.MAX_AMT = t2.AMT
ORDER BY
  t2.CLASS_CODE
  
  
  


select
  users.*,
  latest_scores.score
from
  users
  inner join
  (
    select
      *
    from
      user_scores
    where
      not exists (
        select
          1
        from
          user_scores sub
        where
          user_scores.user_id = sub.user_id
          and user_scores.created_at < sub.created_at
      )
  ) latest_scores
    on
      users.id = latest_scores.user_id
;
提出情報
提出日時2022/10/19 20:41:38
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者fsnfskcewf
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量95 MB
メッセージ
SQLITE_ERROR: near "SELECT": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
92 MB
データパターン2
RE
95 MB