Skip to content

Instantly share code, notes, and snippets.

@cagartner
Created October 24, 2018 12:32
Show Gist options
  • Save cagartner/05f3b021cff41be03fb5f8eb3879cc09 to your computer and use it in GitHub Desktop.
Save cagartner/05f3b021cff41be03fb5f8eb3879cc09 to your computer and use it in GitHub Desktop.
MYSQL RAW SELECTS FOR MAGENTO
# Get Customers taxvat
SELECT ce.*, ea.attribute_code, cev.value
FROM customer_entity AS ce
LEFT JOIN eav_attribute AS ea ON ce.entity_type_id = ea.entity_type_id AND ea.backend_type = 'varchar'
LEFT JOIN customer_entity_varchar AS cev ON ce.entity_id = cev.entity_id AND ea.attribute_id = cev.attribute_id
WHERE ea.attribute_code = 'taxvat';
# Get Customer Data from orders
SELECT `increment_id`, `customer_id`, `customer_firstname`, `customer_email`, `customer_taxvat` FROM `sales_flat_order`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment