ソースコード
with with_code as (
select distinct
        FIRST_VALUE(CLASS_NAME ) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as CLASS
      , FIRST_VALUE(CLASS_CODE ) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as CLASS_CODE
      , FIRST_VALUE(PERSON_NAME) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as PERSON
      , FIRST_VALUE(AMT        ) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as HOUSEHOLDS
    from
        HOUSEHOLD
    where
        PERSON_CODE <> '1'
    and CLASS_CODE  <> '01'
)
select
    CLASS
  , PERSON
  , HOUSEHOLDS
from
    with_code
order by
   CLASS_CODE asc
提出情報
提出日時2022/10/19 19:24:05
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者kamaoda
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量111 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
92 MB
データパターン2
AC
111 MB