ソースコード
with base_point as (
    --基準地点
    select
        LATITUDE as base_LA
        ,LONGITUDE as base_LO
    from
        LOCATION_TBL
    where
        DISTRICT_CODE = '1101'
    ),
    
    distance_list as (
    select
        l.DISTRICT_CODE as CODE
        ,d.DISTRICT_NAME as NAME
        ,l.LATITUDE as LAT
        ,l.LONGITUDE as LON
        ,sqrt(POW((l.LATITUDE - base_LA),2) + POW((l.LONGITUDE - base_LO),2)) as distance
    from
        LOCATION_TBL l
        ,base_point
        left join DISTRICT d on l.DISTRICT_CODE = d.DISTRICT_CODE
    )
select
    cast(CODE as varchar) as CODE
    ,cast(NAME as varchar) as NAME
    ,cast(LAT as real) as LAT
    ,cast(LON as real) as LON
--    ,distance
from distance_list l
where
    l.CODE <> '1101'
order by distance desc
        ,1
;
提出情報
提出日時2023/04/17 00:38:16
コンテスト第6回 SQLコンテスト
問題位置情報
受験者keisuke_nakata
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量99 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
99 MB
データパターン2
WA
98 MB
データパターン3
AC
92 MB