ソースコード
SELECT
    T01.ITEM_CODE AS CODE,
    T01.ITEM_NAME AS NAME,
    'UPDATED' AS COMP_RSLT
FROM
    ITEM T01
    INNER JOIN ITEM_HISTORY AS T02
        ON T02.ITEM_CODE = T01.ITEM_CODE
WHERE
    T01.USER_UPDATE_DATETIME <> T02.USER_UPDATE_DATETIME
UNION
SELECT
    T11.ITEM_CODE AS CODE,
    T11.ITEM_NAME AS NAME,
    'ADDED' AS COMP_RSLT
FROM
    ITEM T11
    LEFT JOIN ITEM_HISTORY AS T12
        ON T11.ITEM_CODE = T12.ITEM_CODE
WHERE
    T11.USER_UPDATE_DATETIME IS NOT NULL AND
    T12.ITEM_CODE IS NULL
UNION
SELECT
    T21.ITEM_CODE AS CODE
    , T21.ITEM_NAME AS NAME
    , 'DELETED' AS COMP_RSLT
FROM
    ITEM_HISTORY AS T21
    LEFT JOIN ITEM AS T22
        ON T21.ITEM_CODE = T22.ITEM_CODE
WHERE
    T21.USER_UPDATE_DATETIME IS NOT NULL AND
    T22.ITEM_CODE IS NULL
ORDER BY
    CODE DESC;
提出情報
提出日時2024/09/18 12:00:11
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者nanabantram
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
84 MB
データパターン3
AC
83 MB