ソースコード
select
PORT.PORT_CODE as 港コード,
PORT_NAME as 港名,
(select sum(AMT) from IMMIGRATION where GROUP_CODE = 120 and IMMIGRATION.PORT_CODE = PORT.PORT_CODE and IMMIGRATION.KIND_CODE = 110)
as 入国者数,
(select sum(AMT) from IMMIGRATION where GROUP_CODE = 120 and IMMIGRATION.PORT_CODE = PORT.PORT_CODE and IMMIGRATION.KIND_CODE = 120)
as 出国者数,
(select sum(AMT) from IMMIGRATION where GROUP_CODE = 120 and IMMIGRATION.PORT_CODE = PORT.PORT_CODE and IMMIGRATION.KIND_CODE = 110) -
(select sum(AMT) from IMMIGRATION where GROUP_CODE = 120 and IMMIGRATION.PORT_CODE = PORT.PORT_CODE and IMMIGRATION.KIND_CODE = 120)
as 差分
from PORT
where 差分 > 0
order by 差分 desc, PORT.PORT_CODE desc
提出情報
提出日時2022/07/20 20:54:56
コンテスト第1回 SQLコンテスト
問題港入出国者分析
受験者kobae964
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量101 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
98 MB
データパターン2
AC
101 MB