ソースコード
SELECT CODE, NAME, COMP_RSLT
FROM (
SELECT 
 i1.ITEM_CODE as 'CODE'
,i1.ITEM_NAME as 'NAME'
,'UPDATED' as 'COMP_RSLT'
from ITEM as 'i1'
where EXISTS(
    SELECT * from ITEM_HISTORY as h1 
    where i1.ITEM_CODE = h1.ITEM_CODE 
    and i1.USER_UPDATE_DATETIME != h1.USER_UPDATE_DATETIME)
UNION ALL
SELECT 
 i2.ITEM_CODE as 'CODE'
,i2.ITEM_NAME as 'NAME'
,'ADDED' as 'COMP_RSLT'
from ITEM as 'i2'
where NOT EXISTS(
    SELECT * from ITEM_HISTORY as h2
    where i2.ITEM_CODE = h2.ITEM_CODE 
    )
UNION ALL
SELECT 
 i3.ITEM_CODE as 'CODE'
,i3.ITEM_NAME as 'NAME'
,'DELETED' as 'COMP_RSLT'
from ITEM_HISTORY as 'i3'
where NOT EXISTS(
    SELECT * from ITEM as h3
    where i3.ITEM_CODE = h3.ITEM_CODE 
    )
) as 'sub'
order by CODE desc
;
提出情報
提出日時2024/04/21 22:44:10
コンテスト第12回 SQLコンテスト
問題データ操作履歴
受験者bayou
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量83 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
AC
83 MB
データパターン3
AC
83 MB