I want to display total numbe开发者_开发知识库r of products sold for each product. There are around 30 products in my virtue mart and I want each one's total sold number.
Table named jos_vm_order_item contains product_id and product_quantity with all other information.
How can I display this?
SELECT O.product_id,
SUM(O.product_quantity) as Total_Sold
FROM jos_vm_order_item O
GROUP BY O.product_id
精彩评论