任何人都知道如何创建代码以删除Hybris中的重复产品数据?使用impex脚本还是修改代码?
答案 0 :(得分:2)
问题:如何删除名称重复的Hybris产品?
您可以运行 SQL /灵活查询来查找重复的产品,然后使用SQL查询删除这些pk列表。
select MIN({p.pk}) as pks
from {Product! as p
JOIN CatalogVersion as CV on {p.catalogversion}={CV:PK} and {CV:version} = 'Online'
JOIN Catalog as C on {CV:catalog}={C:PK} and {C:id}='myProductCatalog'
}
group by {p:name}
having
count(*) > 1
从上面的查询中删除所有pks get。对Online
版本重复此操作。
答案 1 :(得分:0)
首先,使用以下灵活搜索找到重复的 CMSItems
SELECT {UID} as uid,{CatalogVersion} as CatalogVersion , count(1) as cnt from {CMSItem} GROUP BY {UID},{CatalogVersion} HAVING COUNT(1) > 1
然后删除重复的。