ソースコード
with t1 as
(select i.ITEM_CODE as "CODE", i.ITEM_NAME as "NAME", 'ADDED' as "COMP_RSLT" from item i where not exists (select 1 from ITEM_HISTORY ih where i.ITEM_CODE = ih.ITEM_CODE))
, t2 as
(select i.ITEM_CODE as "CODE" , i.ITEM_NAME as "NAME", 'DELETED' as "COMP_RSLT" from ITEM_HISTORY i where not exists (select 1 from ITEM ih where i.ITEM_CODE = ih.ITEM_CODE))
, t3 as
(select i.ITEM_CODE as "CODE" , i.ITEM_NAME as "NAME", 'UPDATED' as "COMP_RSLT" from item i join ITEM_HISTORY ih on i.ITEM_CODE = ih.ITEM_CODE and i.USER_UPDATE_DATETIME != ih.USER_UPDATE_DATETIME)


select * from t1
union
select * from t2
union
select * from t3
order by t1."CODE" desc
提出情報
提出日時2024/04/21 13:58:04
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者SKT0205
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
83 MB
データパターン3
AC
84 MB