Created
April 12, 2013 13:23
-
-
Save GreatPotato/5371959 to your computer and use it in GitHub Desktop.
Gets the top selling products in LemonStand
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 t2.sku, t2.name, t2.price, SUM(t1.quantity) | |
FROM shop_order_items t1 | |
LEFT JOIN shop_products t2 | |
ON t1.shop_product_id = t2.id | |
GROUP BY t2.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment