Skip to content

Instantly share code, notes, and snippets.

@neilbradley
Created April 7, 2017 09:07
Show Gist options
  • Save neilbradley/1c5807766b23631342f4f8924a930c72 to your computer and use it in GitHub Desktop.
Save neilbradley/1c5807766b23631342f4f8924a930c72 to your computer and use it in GitHub Desktop.
Find Duplicate SKUs in Magento
SELECT
DISTINCT(`sku`) as `sku`,
COUNT(`sku`) as `skuCount`,
entity_id
FROM
catalog_product_entity
GROUP BY
`sku`
HAVING
`skuCount` > 1;
@albertobraschi
Copy link

ERROR 1055 (42000): Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dev_quartinhos.catalog_product_entity.entity_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment