Skip to content

Instantly share code, notes, and snippets.

@the-nerdery-dot-info
Last active June 22, 2016 11:51
Show Gist options
  • Save the-nerdery-dot-info/4487a15b28ed78d6027f91d4815a44f5 to your computer and use it in GitHub Desktop.
Save the-nerdery-dot-info/4487a15b28ed78d6027f91d4815a44f5 to your computer and use it in GitHub Desktop.
useful magento 1.9.x sql statements
#this selects configurable products that don't have any simple products associated with them
select entity_id from `catalog_product_entity` where 'type_id' = 'configurable' AND entity_id NOT IN (SELECT DISTINCT parent_id FROM catalog_product_super_link);
#this selects simple products not associated with a configurable one
select entity_id, sku from catalog_product_entity where type_id = 'simple' AND entity_id NOT IN (SELECT DISTINCT product_id FROM catalog_product_super_link);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment