ソースコード
select
I.PORT_CODE as "港コード"
, P.PORT_NAME as "港名"
, sum(case when KIND_CODE = 110 then AMT else 0 end) as "入国者数"
, sum(case when KIND_CODE = 120 then AMT else 0 end) as "出国者数"
, sum(case when KIND_CODE = 110 then AMT else 0 end) - sum(case when KIND_CODE = 120 then AMT else 0 end) as "差分"
from IMMIGRATION as I
inner join PORT as P on P.PORT_CODE = I.PORT_CODE
group by I.PORT_CODE
having sum(case when KIND_CODE = 110 then AMT else 0 end) > sum(case when KIND_CODE = 120 then AMT else 0 end)
order by 5 desc, 1 desc
提出情報
提出日時2022/07/20 21:09:19
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者mamejika
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量101 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
101 MB
データパターン2
AC
99 MB