ソースコード
WITH ADDED AS (
    SELECT
        i.ITEM_CODE AS CODE,
        i.ITEM_NAME AS NAME,
        'ADDED' AS COMP_RSLT
    FROM ITEM AS i
    LEFT JOIN ITEM_HISTORY AS h
    ON i.ITEM_CODE = h.ITEM_CODE
    WHERE h.ITEM_CODE IS NULL
),
DELETED AS (
    SELECT
        h.ITEM_CODE AS CODE,
        h.ITEM_NAME AS NAME,
        'DELETED' AS COMP_RSLT
    FROM ITEM_HISTORY AS h
    LEFT JOIN ITEM AS i
    ON h.ITEM_CODE = i.ITEM_CODE
    WHERE i.ITEM_CODE IS NULL
),
UPDATED AS (
    SELECT
        i.ITEM_CODE AS CODE,
        i.ITEM_NAME AS NAME,
        'UPDATED' AS COMP_RSLT
    FROM ITEM AS i
    INNER JOIN ITEM_HISTORY AS h
    ON i.ITEM_CODE = h.ITEM_CODE
    WHERE i.USER_UPDATE_DATETIME != h.USER_UPDATE_DATETIME
)
SELECT * FROM ADDED
UNION ALL
SELECT * FROM DELETED
UNION ALL
SELECT * FROM UPDATED
ORDER BY CODE
提出情報
提出日時2024/05/06 21:52:27
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者yoichi22
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量83 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
83 MB
データパターン2
WA
83 MB
データパターン3
WA
83 MB