MySQL Forums
Forum List  »  Newbie

Total Stock (Roll Up)
Posted by: Tony Bermingham
Date: April 14, 2018 08:25AM

Hi,

I am trying to display the total stock sold, i want to group by the supplier with roll up.

Sales table includes:
PRODUCT_ID, CUSTOMER_ID, SALES_AMOUNT, QUANTITY, TRANSACTION_DATE, SUPPLIER

SELECT product_id, Sum(quantity) as Units_Sold, vendor
FROM sales
GROUP BY Vendor WITH ROLLUP;

What am i doing wrong?

Options: ReplyQuote


Subject
Written By
Posted
Total Stock (Roll Up)
April 14, 2018 08:25AM
April 14, 2018 08:43AM
April 14, 2018 02:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.