ソースコード
with DELETEITEM as
(
SELECT ITEM_CODE,
       "DELETED" AS JOUTAI_DELETE
FROM ITEM_HISTORY
EXCEPT
SELECT  ITEM_CODE,
       "DELETED"  AS JOUTAI_DELETE
FROM ITEM
),
ADDITEM as
(
SELECT ITEM_CODE,
       "ADDED" AS JOUTAI_ADD 
FROM ITEM
EXCEPT
SELECT ITEM_CODE,
       "ADDED"  AS JOUTAI_ADD
FROM ITEM_HISTORY
),
UPDATEITEM AS
(
SELECT
i.ITEM_CODE,
"UPDATED" AS JOUTAI_UPDATED
FROM ITEM i
INNER JOIN ITEM_HISTORY ih ON i.ITEM_CODE  = ih.ITEM_CODE  AND i.UPDATE_USER_NAME = ih.UPDATE_USER_NAME
WHERE i.USER_UPDATE_DATETIME <> ih.USER_UPDATE_DATETIME
),
UNIONTABLE AS
(SELECT * FROM DELETEITEM
UNION
SELECT * FROM ADDITEM)

SELECT * FROM UPDATEITEM
UNION
SELECT * FROM UNIONTABLE
ORDER BY ITEM_CODE DESC

提出情報
提出日時2024/04/19 15:59:01
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者korogu
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
85 MB
データパターン3
WA
85 MB