ソースコード
WITH RANK_AMOUNT AS
(
    SELECT
        RANK() OVER(ORDER BY TOTAL_VALUE DESC) AS RANK,
        TOTAL_VALUE
    FROM
        CONVENIENCE
    WHERE
        SURVEY_YEAR = 2019
    AND KIND_CODE = '100'
),
RANK_POINT AS
(
    SELECT
        MAX(RANK) / 2 AS SU_1,
        MAX(RANK) / 2 + 1 AS SU_2
    FROM
        RANK_AMOUNT
)
SELECT
    ROUND(CAST((RANK_1.TOTAL_VALUE + RANK_2.TOTAL_VALUE) AS DOUBLE) / CAST(2 AS DOUBLE), 0) AS SA_MEDIAN
FROM
    RANK_POINT
    INNER JOIN
    RANK_AMOUNT AS RANK_1
    ON RANK_POINT.SU_1 = RANK_1.RANK
    INNER JOIN
    RANK_AMOUNT AS RANK_2
    ON RANK_POINT.SU_2 = RANK_2.RANK
;
提出情報
提出日時2022/12/09 18:44:22
コンテスト第4回 SQLコンテスト
問題中央値の算出
受験者hiro200261
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
AC
79 MB
データパターン3
WA
94 MB