此查询返回与 POG.Dbkey 相关的产品数量。我需要找到所有重复项以比较哪些具有相同的产品,哪些具有相同数量的产品。
--每个货架图中的总产品
select pog.DBKey
,Count(pos.DBParentProductKey)
as Total
from ix_spc_planogram as pog with (nolock)
, ix_spc_position as pos with (nolock)
where pog.dbkey = pos.dbparentplanogramkey
and pog.Value4= 358
group by pog.dbkey