ソースコード
WITH C_LAT AS(
    SELECT
        CAST(LATITUDE AS FLOAT) AS LATITUDE
    FROM LOCATION_TBL
    WHERE DISTRICT_CODE = '1101'
)
,C_LON AS(
    SELECT
        CAST(LONGITUDE AS FLOAT) AS LONGITUDE
    FROM LOCATION_TBL
    WHERE DISTRICT_CODE = '1101'
)
SELECT
    T1.DISTRICT_CODE AS CODE
    ,T2.DISTRICT_NAME AS NAME
    ,T1.LATITUDE AS LAT
    ,T1.LONGITUDE AS LON
    ,SQRT(POWER(CAST(T1.LATITUDE AS FLOAT) - (SELECT LATITUDE FROM C_LAT), 2) + POWER(CAST(T1.LONGITUDE AS FLOAT) - (SELECT LONGITUDE FROM C_LON), 2))
FROM
    LOCATION_TBL T1
LEFT JOIN
    DISTRICT T2
ON T1.DISTRICT_CODE = T2.DISTRICT_CODE
WHERE T1.DISTRICT_CODE != '1101'
ORDER BY
    SQRT(POWER(CAST(T1.LATITUDE AS FLOAT) - (SELECT LATITUDE FROM C_LAT), 2) + POWER(CAST(T1.LONGITUDE AS FLOAT) - (SELECT LONGITUDE FROM C_LON), 2)) DESC
    ,T1.DISTRICT_CODE ASC
提出情報
提出日時2023/05/08 15:21:16
コンテスト第6回 SQLコンテスト
問題位置情報
受験者mott
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
77 MB
データパターン2
WA
79 MB
データパターン3
WA
77 MB