Folding subtotals into query? - Mailing list pgsql-general

From Jerry LeVan
Subject Folding subtotals into query?
Date
Msg-id FF81597A-9167-11D8-9438-000393779D9C@eku.edu
Whole thread Raw
Responses Re: Folding subtotals into query?
List pgsql-general
Is is possible, via some clever sql coding ( perhaps with PL/pgsql)
to get subtotals to appear in a selection, ie

If I have a query: select * from checks order by category
I would like the have the subtotals appear (possibly in
an unused column for each "category" when the category
"breaks".

Basically I would like to meld the query:
select category, sum(amount) from checks group by category order by
category

Into the of the first select.

Thanks,

Jerry


pgsql-general by date:

Previous
From: Frank Finner
Date:
Subject: Re: Mixed UTF8 / Latin1 database
Next
From: Eric Ridge
Date:
Subject: Re: Folding subtotals into query?