ソースコード
select
    t3.CODE
    ,t3.NAME
    ,t3.LAT
    ,t3.LON
from
    (select
        t2.DISTRICT_CODE as 'CODE'
        ,di.DISTRICT_NAME as 'NAME'
        ,t2.LATITUDE as 'LAT'
        ,t2.LONGITUDE as 'LON'
        ,( 
        6371 * ACOS( 
          COS(RADIANS(t1.t1_LAT)) * COS(RADIANS(t2.LATITUDE)) * COS(RADIANS(t2.LONGITUDE) - RADIANS(t1.t1_LON))
           + SIN(RADIANS(t1.t1_LAT)) * SIN(RADIANS(t2.LATITUDE))
        )) as 'DIST'
    from
        LOCATION_TBL t2
    inner join
        DISTRICT di
        on di.DISTRICT_CODE = t2.DISTRICT_CODE
    full join
        (select
             DISTRICT_CODE as 't1_CODE'
            ,LATITUDE as 't1_LAT'
            ,LONGITUDE as 't1_LON'
        from
            LOCATION_TBL
        where
            DISTRICT_CODE = '1101'
        ) t1
        --on t1.DISTRICT_CODE = t2.DISTRICT_CODE
    where 
        t2.DISTRICT_CODE <> '1101'
    ) t3
order by
    t3.DIST desc
    ,t3.CODE asc

提出情報
提出日時2023/04/16 23:55:04
コンテスト第6回 SQLコンテスト
問題位置情報
受験者minami127
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量96 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
96 MB
データパターン2
WA
89 MB
データパターン3
WA
89 MB