ソースコード
SELECT
  DISTRICT_TBL.DISTRICT_CODE AS CODE,
  district.DISTRICT_NAME AS NAME,
  DISTRICT_TBL.LATITUDE AS LAT,
  DISTRICT_TBL.LONGITUDE AS LON
FROM
  (
    SELECT
      PF_CODE,
      DISTRICT_CODE,
      LATITUDE,
      LONGITUDE,
      abs((
        (LATITUDE - (
          SELECT LATITUDE FROM LOCATION_TBL WHERE DISTRICT_CODE = '1101'
        )) * (LATITUDE - (
          SELECT LATITUDE FROM LOCATION_TBL WHERE DISTRICT_CODE = '1101'
        ))) + (
        (LONGITUDE - (
          SELECT LONGITUDE FROM LOCATION_TBL WHERE DISTRICT_CODE = '1101'
        )) * (LONGITUDE - (
          SELECT LONGITUDE FROM LOCATION_TBL WHERE DISTRICT_CODE = '1101'
        ))))
        AS DISTANCE
    FROM
      LOCATION_TBL
    WHERE
      DISTRICT_CODE <> '1101'
  ) DISTRICT_TBL
   left join DISTRICT on district.DISTRICT_CODE = DISTRICT_TBL.DISTRICT_CODE
ORDER BY
  DISTRICT_TBL.DISTANCE DESC,
  DISTRICT_TBL.DISTRICT_CODE ASC;
提出情報
提出日時2023/04/14 16:09:45
コンテスト第6回 SQLコンテスト
問題位置情報
受験者udo
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量82 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
82 MB
データパターン2
WA
80 MB
データパターン3
AC
81 MB