ソースコード
SELECT 
S.DISTRICT_CODE AS CODE,
D.DISTRICT_NAME AS NAME,
S.LATITUDE AS LAT,
S.LONGITUDE  AS LON
FROM
(
SELECT
P.DISTRICT_CODE ,
P.LATITUDE,
P.LONGITUDE ,
 ( 
6371 * ACOS( 
      COS(RADIANS(A.LAT)) * COS(RADIANS(P.LATITUDE)) * 
      COS(RADIANS(P.LONGITUDE) - RADIANS(A.LON))
       + SIN(RADIANS(A.LAT)) * SIN(RADIANS(P.LATITUDE))
)
 ) AS DISTANCE 
FROM
LOCATION_TBL AS P
LEFT JOIN
(SELECT 
LATITUDE AS LAT,
LONGITUDE AS LON
FROM LOCATION_TBL
WHERE
DISTRICT_CODE  ='1101'
) AS A 
WHERE
P.DISTRICT_CODE  <> '1101'
) AS S
LEFT JOIN DISTRICT AS D ON
D.DISTRICT_CODE = S.DISTRICT_CODE
ORDER BY 
DISTANCE DESC, S.DISTRICT_CODE ASC
提出情報
提出日時2023/04/15 00:32:33
コンテスト第6回 SQLコンテスト
問題位置情報
受験者ketupablakistoni
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量87 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
87 MB
データパターン2
WA
82 MB
データパターン3
WA
77 MB