Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想显示每种产品售出的产品总数。我的美德商城里有大约 30 种产品,我想要每个产品的总销量。
名为 jos_vm_order_item 的表包含 product_id 和 product_quantity 以及所有其他信息。
我怎样才能显示这个?
SELECT O.product_id, SUM(O.product_quantity) as Total_Sold FROM jos_vm_order_item O GROUP BY O.product_id