Created
February 6, 2014 15:42
-
-
Save tegansnyder/8846664 to your computer and use it in GitHub Desktop.
Get a list of all customers by int attribute is_dealers - Magento sql
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 cv.value as `is_dealer`, e.* FROM customer_entity AS e | |
LEFT JOIN customer_entity_int AS cv | |
ON ( cv.attribute_id = ( | |
SELECT attribute_id FROM eav_attribute | |
WHERE entity_type_id = e.entity_type_id | |
AND attribute_code = 'is_dealer' | |
) | |
AND cv.entity_id = e.entity_id) | |
WHERE cv.value = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment