ソースコード
select
    round(avg(TOTAL_VALUE)) as SA_MEDIAN
from
(
select
    TOTAL_VALUE
    ,row_number() over(partition by '' order by TOTAL_VALUE) as RN
    ,row_number() over(partition by '' order by TOTAL_VALUE)+0.5 as RN01
    ,row_number() over(partition by '' order by TOTAL_VALUE)-0.5 as RN02
from
    CONVENIENCE
where
    SURVEY_YEAR='2019'
    and KIND_CODE='100'
    and TOTAL_VALUE<>0
) SUB
where
    RN in (select cast( count(*) as real)/2 from CONVENIENCE where SURVEY_YEAR='2019' and KIND_CODE='100' and TOTAL_VALUE<>0)
    or 
    RN01 in (select cast( count(*) as real)/2 from CONVENIENCE where SURVEY_YEAR='2019' and KIND_CODE='100' and TOTAL_VALUE<>0)
    or
    RN02 in (select cast( count(*) as real)/2 from CONVENIENCE where SURVEY_YEAR='2019' and KIND_CODE='100' and TOTAL_VALUE<>0)
    
提出情報
提出日時2022/12/11 14:53:22
コンテスト第4回 SQLコンテスト
問題中央値の算出
受験者1120011
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量81 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
81 MB
データパターン2
AC
79 MB
データパターン3
WA
79 MB