I need to run a query where I can get a subtotal for each items in a table. The query should produce something like:
I did a SUM and COUNT function but, I get the total records (8) in the table instead of the subtotals.
SELECT id, SUM(fruit) AS Total
WHERE ORDER BY fruit
Any suggestions would be great.