Skip to content

Instantly share code, notes, and snippets.

@heathdutton
Created December 14, 2012 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heathdutton/4288090 to your computer and use it in GitHub Desktop.
Save heathdutton/4288090 to your computer and use it in GitHub Desktop.
Find all instances of registry/holiday products that are missing from the website that they exist in.
/* Find all instances of registry/holiday products that are missing from the website that they exist in */
SELECT * FROM
enterprise_giftregistry_item,
enterprise_giftregistry_entity,
catalog_product_website
WHERE
enterprise_giftregistry_entity.entity_id = enterprise_giftregistry_item.entity_id AND /* get the registry entity */
enterprise_giftregistry_item.product_id = catalog_product_website.product_id AND /* get the product entity */
enterprise_giftregistry_entity.website_id NOT IN (
SELECT
catalog_product_website.website_id
FROM
catalog_product_website
WHERE
catalog_product_website.product_id = enterprise_giftregistry_item.product_id
); /* check if the product is in the website tied to the registry */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment