Is it possible to have a group of item listed with details and put their subsummary using SQL + html formatting?
Now I’m using this query to retrieve expenses types:
SELECT SUM(p.expense_amount), t.expense_type, t.expense_description
from balance p, expenses t
where p.yearnr = 2003 and p.expenseid = t.expenseid
group by p.expenseid, t.expense_type, t.expense_description
order by 2 asc
So I get
Apples Golden 5.50
Apples Stark 15.30
Pears Williams 8.00
Bananas Chiquita 3.20
Total: 32.00
Which is fine, but how can I have
Apples Golden 5.50
Apples Stark 15.30
Apples total: 20.80
Pears Williams 8.00
Pears total: 8.00
Bananas Chiquita 3.20
Bananas total: 3.20
Total: 32.00
I thought it could be possible using a lot of queries, but I’m sure there’s an easier way