if object_id('tempdb..#dataOldNew1') is not null drop table #dataOldNew1
select
distinct store_cd
,item_cd
, ItemType
, CompStoreNM
, CompPrice
-- , CompStandardNum
-- , CompBrandNM
, CreateDate
into
#dataOldNew1
from
#alldata as a
where
(
select count(o) from #alldata as b
where
a.item_cd=b.item_cd
and
a.store_cd=b.store_Cd
and
a.CompStoreNM=b.CompStoreNM
and
a.inum<b.inum
--a.createdate<b.createdate
)<1

相关文章:

  • 2022-12-23
  • 2021-11-11
  • 2021-09-20
  • 2022-12-23
  • 2021-11-28
  • 2021-07-23
  • 2021-08-14
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2021-11-23
  • 2022-01-03
  • 2021-11-21
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案