ソースコード
SELECT
  II.PORT_CODE AS "港コード",
  P.PORT_NAME AS "港名",
  II.AMT AS "入国者数",
  IO.AMT AS "出国者数",
  (II.AMT - IO.AMT) AS "差分"
FROM
  IMMIGRATION AS II
INNER JOIN
  PORT AS P
  ON
    II.PORT_CODE = P.PORT_CODE
INNER JOIN
  IMMIGRATION AS IO
  ON
    II.PORT_CODE = IO.PORT_CODE AND
    IO.KIND_CODE = "120" AND
    IO.GROUP_CODE = "120"
WHERE
  II.KIND_CODE = "110" AND
  II.GROUP_CODE = "120" AND
  "差分" > 0
GROUP BY
  II.PORT_CODE
ORDER BY
  "差分" DESC,
  II.PORT_CODE DESC
;
提出情報
提出日時2022/07/20 22:05:29
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者mznmk
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量104 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
104 MB
データパターン2
AC
97 MB