ソースコード
/*
select 
L.DISTRICT_CODE as CODE
,DISTRICT_NAME as NAME
,LATITUDE as LAT
,LONGITUDE as LON
,SQRT(abs(LATITUDE-LAT11)*abs(LATITUDE-LAT11)+abs(LONGITUDE-LON11)*abs(LONGITUDE-LON11))
,LAT11
,LON11
from 
LOCATION_TBL L,
(select LATITUDE as LAT11,LONGITUDE  as LON11 from LOCATION_TBL where DISTRICT_CODE = '1101' ) A11
left join DISTRICT D ON L.DISTRICT_CODE = D.DISTRICT_CODE

where L.DISTRICT_CODE <> '1101' 
order by 
SQRT(abs(LAT-LAT11)*abs(LAT-LAT11)+abs(LON-LON11)*abs(LON-LON11)) desc
,L.DISTRICT_CODE asc
*/

select 
L.DISTRICT_CODE as CODE
,DISTRICT_NAME as NAME
,LATITUDE as LAT
,LONGITUDE as LON
from 
LOCATION_TBL L,
(select ifnull(LATITUDE,0) as LAT11,ifnull(LONGITUDE,0)  as LON11 from LOCATION_TBL where DISTRICT_CODE = '1101' ) A11
left join DISTRICT D ON L.DISTRICT_CODE = D.DISTRICT_CODE
where L.DISTRICT_CODE <> '1101' 
order by 
SQRT(abs(ifnull(LAT,0)-LAT11)*abs(ifnull(LAT,0)-LAT11)+abs(ifnull(LON,0)-LON11)*abs(ifnull(LON,0)-LON11)) desc
,L.DISTRICT_CODE asc
提出情報
提出日時2023/04/17 01:27:05
コンテスト第6回 SQLコンテスト
問題位置情報
受験者20230217mori
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量101 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
78 MB
データパターン2
WA
101 MB
データパターン3
AC
85 MB