In the last episode (Dec 06), Ronald Beck said:
> Hello all,
> I have a database for our pagers and one of the columns contains the
> monthly fee charged by the pager service. What can I use to get a
> sub-total by department (yes, I have a department column too) and
> then a grand total of all charges? I don't see an example of this
> type of query in Chapter 8 and I don't really know what to look for
> in the commands section. I don't see any reference to generating
> totals in the SELECT definition.
In the simplest case,
SELECT dept, SUM(amount) FROM pagercharges GROUP BY dept;
will total the 'amount' column for each department. You'll need
another SELECT to pull the grand total, or calculate it yourself from
the results of the first select.