ソースコード
select 
    it.ITEM_CODE as CODE,
    it.ITEM_NAME as NAME
from 
    ITEM as it
where
    not exists(
        select
            it.ITEM_CODE as CODE,
            it.ITEM_NAME as NAME
        from 
            ITEM_HISTORY as ith
        where 
            it.ITEM_CODE = ith.ITEM_CODE and it.ITEM_NAME = ith.ITEM_NAME
    )
union
select 
    it.ITEM_CODE as CODE,
    null as NAME
from 
    ITEM as it
where
    exists(
        select
            it.ITEM_CODE as CODE,
            it.ITEM_NAME as NAME
        from 
            ITEM_HISTORY as ith
        where 
            it.ITEM_CODE = ith.ITEM_CODE and it.ITEM_NAME = ith.ITEM_NAME
    )
order by
    CODE desc
;
提出情報
提出日時2024/07/24 09:23:08
コンテスト第13回 SQLコンテスト
問題名称比較
受験者asano
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
85 MB