ソースコード
WITH
    add_item AS(
        SELECT * FROM ITEM
        EXCEPT
        SELECT * FROM ITEM_HISTORY
    )

  , del_item AS(
        SELECT * FROM ITEM_HISTORY
        EXCEPT
        SELECT * FROM ITEM
    )

  , upd_item AS(
        SELECT
            ITM.*
        FROM
            ITEM AS ITM LEFT JOIN ITEM_HISTORY AS ITM_H
                ON (ITM.ITEM_CODE = ITM_H.ITEM_CODE)
        WHERE
            ITM.USER_UPDATE_DATETIME <> ITM_H.USER_UPDATE_DATETIME
    )

SELECT del_item.ITEM_CODE AS CODE
     , del_item.ITEM_NAME AS NAME
     , 'DELETED'          AS COMP_RSLT
  FROM del_item

EXCEPT

SELECT add_item.ITEM_CODE AS CODE
     , add_item.ITEM_NAME AS NAME
     , 'ADDED'            AS COMP_RSLT
  FROM add_item

UNION

SELECT upd_item.ITEM_CODE AS CODE
     , upd_item.ITEM_NAME AS NAME
     , 'UPDATED'          AS COMP_RSLT
  FROM upd_item

ORDER BY CODE DESC
;

提出情報
提出日時2024/04/21 22:31:36
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者r-iskw
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量87 MB
メッセージ
テストケース(通過数/総数)
1/3
状態
メモリ使用量
データパターン1
WA
87 MB
データパターン2
WA
84 MB
データパターン3
AC
87 MB