Created
April 3, 2015 19:38
-
-
Save miguelbalparda/447573fa7d2820d2c1c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT email FROM customer_entity as ce JOIN newsletter_subscriber as ns ON ns.subscriber_email = ce.email AND ns.subscriber_status = 1 JOIN sales_flat_order as sfo ON sfo.customer_id = ce.entity_id JOIN sales_flat_order_item as sfoi ON sfo.entity_id = sfoi.order_id JOIN catalog_product_entity as cpe ON cpe.entity_id = sfoi.product_id WHERE cpe.sku !='' group by ce.email; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment