ソースコード
with with_code as (
select distinct
    NTH_VALUE(CLASS_NAME , 1) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as CLASS
  , NTH_VALUE(CLASS_CODE , 1) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as CLASS_CODE
  , NTH_VALUE(PERSON_NAME, 1) OVER(PARTITION BY CLASS_CODE ORDER BY AMT DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as PERSON
  , NTH_VALUE(AMT        , 1) 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'
order by
   CLASS asc
)
select
    CLASS
  , PERSON
  , HOUSEHOLDS
from
    with_code
提出情報
提出日時2022/10/19 18:46:36
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者kamaoda
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量109 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
109 MB
データパターン2
AC
95 MB