Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Created February 6, 2014 15:42
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 tegansnyder/8846664 to your computer and use it in GitHub Desktop.
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
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