Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Created January 20, 2016 19:58
Show Gist options
  • Save molotovbliss/214d83c9ca48be2189d9 to your computer and use it in GitHub Desktop.
Save molotovbliss/214d83c9ca48be2189d9 to your computer and use it in GitHub Desktop.
Report by SKUs SQL for Magento
SELECT name, sku, sum(qty_ordered), sum(row_total)
FROM sales_flat_order_item
WHERE price > 0
AND created_at > "2013-01-01 00:00:00"
GROUP BY sku
ORDER BY sku
LIMIT 1000
# note created_at is in UTC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment