0

I am trying to delete duplicate skus in magento.

I can confirm with this query that duplicates exist on the db.

SELECT `entity_id` FROM `catalog_product_entity` GROUP BY `sku` HAVING (COUNT(*) > 1)

However, from these duplicates that are returned; I want to delete a product that has no image, product name is ALL CAPS, and no brand.

to narrow it down even further as the above conditions can exist on both skus, I don't want to remove both so I want to use the created_at field and delete the one that is older.

This is tricky, I hope it is clear.

Thanks in advance

1 Answer 1

0

How to remove a duplicate sku via database?

this might help you. Extend the Select with whatever you need. To select only uppercase use WHERE name REGEXP '^[A-Z]+$';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.