ソースコード
with cr as (
select *
, rank() over (order by total_value) - 1 r
, count() over () t
from convenience where survey_year = 2019 and kind_code = 100 order by total_value
)
, cr2 as (
select total_value from cr
where r = (t - 1) / 2 or r =  (t / 2)
)
select ROUND(avg(total_value)) as SA_MEDIAN from cr2
提出情報
提出日時2024/04/28 07:52:29
コンテスト第4回 SQLコンテスト
問題中央値の算出
受験者daku10
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
84 MB
データパターン3
AC
83 MB