Forked from tegansnyder/CustomerValue_and_SKUs-Magento-SQL-Query.sql
Created
July 16, 2013 21:16
-
-
Save Medalink/6015225 to your computer and use it in GitHub Desktop.
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 customer_id, customer_email, customer_firstname, customer_lastname, group_concat(si.sku SEPARATOR ',') as skus, SUM(subtotal_invoiced) AS cv | |
FROM sales_flat_order as so | |
INNER JOIN sales_flat_order_item AS si ON si.order_id = so.entity_id | |
GROUP BY customer_email | |
ORDER BY SUM(subtotal_invoiced) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment