ソースコード
with long as (
	select *
		,pow(cast(LATITUDE as real) - cast((select LATITUDE from LOCATION_TBL where DISTRICT_CODE = '1101') as real),2)
		as x2
		,pow(cast(LONGITUDE as real) - cast((select LONGITUDE from LOCATION_TBL where DISTRICT_CODE = '1101') as real),2)
		as y2
	from LOCATION_TBL
)
select d.DISTRICT_CODE as CODE
	,d.DISTRICT_NAME as NAME
	,l.LATITUDE as LAT
	,l.LONGITUDE as LON
from DISTRICT as d
left outer join long as l on d.DISTRICT_CODE = l.DISTRICT_CODE
where (not d.DISTRICT_CODE = '1101') and LAT is not null
order by x2+y2 desc ,d.DISTRICT_CODE
提出情報
提出日時2023/04/17 02:16:15
コンテスト第6回 SQLコンテスト
問題位置情報
受験者turty000
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
92 MB
データパターン2
AC
95 MB
データパターン3
AC
92 MB