ソースコード
with added as (
  select ITEM.ITEM_CODE, ITEM.ITEM_NAME from ITEM left join ITEM_HISTORY on ITEM.ITEM_CODE = ITEM_HISTORY.ITEM_CODE
  where ITEM_HISTORY.ITEM_NAME IS NULL
),
updated AS (
  select ITEM.ITEM_CODE, ITEM.ITEM_NAME from ITEM join ITEM_HISTORY on ITEM.ITEM_CODE = ITEM_HISTORY.ITEM_CODE
  where ITEM.USER_UPDATE_DATETIME != ITEM_HISTORY.USER_UPDATE_DATETIME
),
deleted AS (
  select ITEM_HISTORY.ITEM_CODE, ITEM_HISTORY.ITEM_NAME from ITEM_HISTORY left join ITEM on ITEM.ITEM_CODE = ITEM_HISTORY.ITEM_CODE
  where ITEM.ITEM_NAME IS NULL
)
select ITEM_CODE as CODE, ITEM_NAME as NAME, COMP_RSLT from
(
select *, 'ADDED' as COMP_RSLT from added
union all
select *, 'UPDATED' as COMP_RSLT from updated
union all
select *, 'DELETED' as COMP_RSLT from deleted
)
order by CODE desc
;
提出情報
提出日時2024/04/21 17:21:32
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者daku10
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量87 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
87 MB
データパターン2
AC
84 MB
データパターン3
AC
83 MB