ソースコード
select t1.PORT_CODE 港コード,t1.PORT_NAME 港名,t1.AMT 入国者数,t2.AMT 出国者数, t1.AMT-t2.AMT 差分
from
(
select n.PORT_CODE,n.PORT_NAME,n.AMT
from
(
select p.PORT_CODE,p.PORT_NAME,KIND_CODE,AMT
from 
IMMIGRATION as i
inner join
PORT p on i.PORT_CODE = p.PORT_CODE
inner join
GRP g on i.GROUP_CODE = g.GROUP_CODE
where GROUP_NAME = "外国人"
) as n
where n.KIND_CODE = 110
) as t1

inner join
(
select n.PORT_CODE,n.PORT_NAME,n.AMT
from
(
select p.PORT_CODE,p.PORT_NAME,KIND_CODE,AMT
from 
IMMIGRATION as i
inner join
PORT p on i.PORT_CODE = p.PORT_CODE
inner join
GRP g on i.GROUP_CODE = g.GROUP_CODE
where GROUP_NAME = "外国人"
) as n
where n.KIND_CODE = 120
) as t2
on t1.PORT_CODE = t2.PORT_CODE
where t1.AMT > t2.AMT
提出情報
提出日時2022/07/20 18:04:15
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者SpaceApollo80
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量105 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
102 MB
データパターン2
WA
105 MB