ソースコード
select 
distinct im.PORT_CODE as "港コード",
po.PORT_NAME as "港名",
--(case when im.kind_code = 110 then im.amt else 0 end) as "入国者数",
--(case when im.kind_code = 120 then im.amt else 0 end) as "出国者数",
im1.amt as "入国者数",
im2.amt as "出国者数",
(im1.amt - im2.amt) as "差分"
from immigration as im
inner join port as po on po.port_code = im.port_code 
inner join grp as gr on gr.group_code = im.group_code
inner join immigration as im1 on po.port_code = im1.port_code and gr.group_code = im1.group_code and im1.kind_code = 110
inner join immigration as im2 on po.port_code = im2.port_code and gr.group_code = im2.group_code and im2.kind_code = 120
where im.group_code = 120
and im1.amt >= im2.amt
order by "差分" desc, im.port_code desc
提出情報
提出日時2022/07/20 17:41:17
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者R3m1_C2
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量105 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
105 MB
データパターン2
AC
95 MB