MySQL Forums
Forum List  »  Newbie

Select 9 Columns, Subtotal Only Based on First Column
Posted by: Darren McGettigan
Date: July 03, 2018 11:38AM

Here is my query so far:

SELECT CustomerNumber, CustomerName, City, InvoiceNumber, MFG, PartNumber, PartDescription, Quantity, SUM(TotalSale) as 'Total'
FROM wp_sales_data
WHERE Date >= '2018-06-25'
AND Date <= '2018-06-30'
AND PriceLevel = '138'
GROUP BY CustomerNumber, CustomerName, City, InvoiceNumber, MFG, PartNumber, PartDescription, Quantity, TotalSale WITH ROLLUP

When using ROLLUP, it gives me a 'subtotal' for each and every column.

How do I go about getting just a 'subtotal' for 'CustomerNumber'

Options: ReplyQuote




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.