ソースコード
SELECT
  II.PORT_CODE AS "港コード",
  P.PORT_NAME AS "港名",
  SUM(II.AMT) AS "入国者数",
  SUM(IO.AMT) AS "出国者数",
  ("入国者数" - "出国者数") 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 21:48:25
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者mznmk
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量103 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
103 MB
データパターン2
WA
56 MB