Magento实用SQL

1:检查重复产品Sku

SELECT
DISTINCT(`sku`) as `sku`,
COUNT(`sku`) as `skuCount`, `entity_id` FROM `catalog_product_entity`
GROUP BY `sku` HAVING `skuCount` > 1;

2:检查重复ULR Key

SELECT url_key,
COUNT(url_key) AS NumOccurrences
FROM catalog_product_flat_1
GROUP BY url_key HAVING ( COUNT(url_key) > 1 );

3:检查重复产品名称

SELECT name,
COUNT(name) AS NumOccurrences
FROM catalog_product_flat_1
GROUP BY name HAVING ( COUNT(name) > 1 );

4:

 





Leave a Reply

Be the First to Comment!