ソースコード
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
order by
   CLASS_CODE asc
)
select
    CLASS
  , PERSON
  , HOUSEHOLDS
from
    with_code
    
提出情報
提出日時2022/10/19 18:41:45
コンテスト第3回 SQLコンテスト
問題最大世帯人員
受験者kamaoda
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量109 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
95 MB
データパターン2
WA
109 MB