I want to display total number 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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.