ソースコード
select
 *
from
(select
   i.ITEM_CODE as "CODE"
  ,i.ITEM_NAME as "NAME"
 from
  ITEM i
 join
  ITEM_HISTORY ih
 on
  i.ITEM_CODE = ih.ITEM_CODE
 where
  i.ITEM_NAME <> ih.ITEM_NAME
 union
 select
    i.ITEM_CODE as "CODE"
   ,NULL as "NAME"
 from
  ITEM i
 join
  ITEM_HISTORY ih
 on
  i.ITEM_CODE = ih.ITEM_CODE and i.ITEM_NAME = ih.ITEM_NAME
 union
 select
   i.ITEM_CODE as "CODE"
  ,i.ITEM_NAME as "NAME"
 from
  ITEM i
 where
  not exists
 (select
   '1'
  from
   ITEM_HISTORY ih
  where
   i.ITEM_CODE = ih.ITEM_CODE
 )
)
order by
 "CODE" desc
;
提出情報
提出日時2024/06/22 20:06:23
コンテスト第13回 SQLコンテスト
問題名称比較
受験者SKT0205
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
AC
84 MB