ソースコード
SELECT 
ITM.ITEM_CODE AS CODE
, ITM.ITEM_NAME AS NAME
, 'ADDED' AS COMP_RSLT
FROM
ITEM ITM
WHERE  NOT EXISTS (SELECT * FROM ITEM_HISTORY HIS WHERE ITM.ITEM_CODE = HIS.ITEM_CODE)

UNION ALL

SELECT 
HIS.ITEM_CODE AS CODE
, HIS.ITEM_NAME AS NAME
, 'DELETED' AS COMP_RSLT
FROM
ITEM_HISTORY HIS
WHERE  NOT EXISTS (SELECT * FROM ITEM ITM WHERE ITM.ITEM_CODE = HIS.ITEM_CODE)

UNION ALL

SELECT 
HIS.ITEM_CODE AS CODE
, HIS.ITEM_NAME AS NAME
, 'UPDATED' AS COMP_RSLT
FROM ITEM ITM
INNER JOIN ITEM_HISTORY HIS
ON ITM.ITEM_CODE = HIS.ITEM_CODE
WHERE HIS.UPDATE_USER_NAME <> ITM.UPDATE_USER_NAME
OR HIS.USER_UPDATE_DATETIME <> ITM.USER_UPDATE_DATETIME

ORDER BY CODE DESC
提出情報
提出日時2024/04/22 11:10:20
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者nmanh
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
95 MB
データパターン2
AC
92 MB
データパターン3
AC
82 MB