Skip to content

Instantly share code, notes, and snippets.

@gitfvb
Created October 21, 2015 17:26
Show Gist options
  • Save gitfvb/5faad1bb5060420ffe1d to your computer and use it in GitHub Desktop.
Save gitfvb/5faad1bb5060420ffe1d to your computer and use it in GitHub Desktop.
MySQL Statement for customers on magento including first name, last name and birthday
SELECT
e.entity_id
,e.email
,e.group_id
,e.store_id
,e.created_at
,e.updated_at
,e.is_active
,at_birthday.value as birthday
,at_firstname.value AS firstname
,at_lastname.value AS lastname
FROM customer_entity AS e
LEFT JOIN customer_entity_varchar AS at_firstname ON (at_firstname.entity_id = e.entity_id) AND (at_firstname.attribute_id = '5')
LEFT JOIN customer_entity_varchar AS at_lastname ON (at_lastname.entity_id = e.entity_id) AND (at_lastname.attribute_id = '7')
LEFT JOIN customer_entity_datetime AS at_birthday ON (at_birthday.entity_id = e.entity_id) AND (at_birthday.attribute_id = '11')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment