ソースコード
WITH AD AS (
SELECT ITEM_CODE,ITEM_NAME,'ADDED' AS COMP_RSLT FROM ITEM
WHERE ITEM_CODE NOT IN (SELECT ITEM_CODE FROM ITEM_HISTORY)
)
, UPD AS (
SELECT ITEM_CODE,ITEM_NAME,'UPDATED' AS COMP_RSLT FROM ITEM
WHERE ITEM_CODE IN (SELECT ITEM_CODE  FROM ITEM_HISTORY)
AND USER_UPDATE_DATETIME != (SELECT USER_UPDATE_DATETIME FROM ITEM_HISTORY)
)
, DEL AS (
SELECT ITEM_CODE,ITEM_NAME,'DELETED' AS COMP_RSLT FROM ITEM_HISTORY
WHERE ITEM_CODE NOT IN (SELECT ITEM_CODE FROM ITEM)
)
SELECT
    ITEM_CODE AS CODE, ITEM_NAME AS NAME, COMP_RSLT
FROM
    (SELECT
     * FROM AD
     UNION
     SELECT
     * FROM UPD
     UNION
     SELECT
     * FROM DEL)
ORDER BY ITEM_CODE DESC
    
    
提出情報
提出日時2024/04/22 15:22:40
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者nadia
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
AC
85 MB
データパターン3
AC
83 MB