ソースコード
SELECT PORT.PORT_CODE AS '港コード'
	, PORT.PORT_NAME AS '港名'
	, SUM(IMMIGRATION_IN.AMT) AS '入国者数'
	, SUM(IMMIGRATION_OUT.AMT) AS '出国者数'
	, SUM(IMMIGRATION_IN.AMT) - SUM(IMMIGRATION_OUT.AMT) AS '差分'
FROM PORT
INNER JOIN IMMIGRATION AS IMMIGRATION_IN
	ON PORT.PORT_CODE = IMMIGRATION_IN.PORT_CODE
		AND IMMIGRATION_IN.GROUP_CODE IN ('120')
		AND IMMIGRATION_IN.KIND_CODE = '110'
INNER JOIN IMMIGRATION AS IMMIGRATION_OUT
	ON PORT.PORT_CODE = IMMIGRATION_OUT.PORT_CODE
		AND IMMIGRATION_OUT.GROUP_CODE IN ('120')
		AND IMMIGRATION_OUT.KIND_CODE = '120'
GROUP BY PORT.PORT_CODE
	, PORT.PORT_NAME
ORDER BY (SUM(IMMIGRATION_IN.AMT) - SUM(IMMIGRATION_OUT.AMT)) DESC
	, PORT.PORT_CODE DESC
提出情報
提出日時2022/07/20 18:03:10
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者doan.thuan
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量105 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
102 MB
データパターン2
WA
105 MB