Skip to content

Instantly share code, notes, and snippets.

@joostvanveen
Created September 21, 2017 07:55
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 joostvanveen/2df04f1ae9da65f386904df6f7bed625 to your computer and use it in GitHub Desktop.
Save joostvanveen/2df04f1ae9da65f386904df6f7bed625 to your computer and use it in GitHub Desktop.
Export all customers from Magento 1.9.x - names & email addresses
-- Export all customers from Magento - names & email addresses
select ce.entity_id, concat(cevf.value, ' ', cevl.value) fullname, ce.email
from customer_entity ce
inner join customer_entity_varchar cevf
on ce.entity_id = cevf.entity_id
inner join eav_attribute eaf
on eaf.attribute_id = cevf.attribute_id
inner join customer_entity_varchar cevl
on ce.entity_id = cevl.entity_id
inner join eav_attribute eal
on eal.attribute_id = cevl.attribute_id
inner join eav_entity_type eet
on eet.entity_type_id = eal.entity_type_id = eaf.entity_type_id
where
eet.entity_type_code = 'customer'
and eaf.attribute_code = 'firstname'
and eal.attribute_code = 'lastname'
order by ce.entity_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment