Subject RE: [firebird-support] subtotals
Author Bob Murdoch
Petr,

> -----Original Message-----
> From: mcbootchek [mailto:petr@...]
> Sent: Monday, April 04, 2005 2:09 PM
>
> is there any possibility to get subtotals and total using the
> SELECT command?


You can try using a UNION query:

select
cast(acolumn as varchar(10)), sum(bcolumn)
from
atable
group by
acolumn

union all

select
cast('TOTAL' as varchar(10)), sum(bcolumn)
from
atable


or, you can write a stored procedure that will sum the values of the
details as they are output, and sends a final row with the total.

hth,

Bob M..