ソースコード
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,
      (
        (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:06:09
コンテスト第6回 SQLコンテスト
問題位置情報
受験者udo
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
2/3
状態
メモリ使用量
データパターン1
AC
79 MB
データパターン2
WA
79 MB
データパターン3
AC
78 MB