Tom,

> You can't have aggregates of aggregates in a single SELECT structure;
> that's just not in the SQL execution model.  The way around this is
> to write multiple levels of SELECT, using either selection from a
> grouped/aggregated view or subselect-in-FROM.  Unfortunately Postgres
> doesn't have either of those features --- yet.  They might be in 7.1
> if I spend less time answering email and more time coding...

Well, stop answering your e-mail, then, dammit!
(impatiently waiting for 7.1)

Seriously, you could actually slack (as in wait 8-12 hours) on answering
the questions.  There's been several basic SQL questions I could have
fielded and you answered them first.

Unfortunately, Louis-David, I don't see any way around subselects in the
FROM clause as Tom mentions, which are not currently supported.  I'd
suggest using a Function to create a temporary table or view and
summarizing from that.

-Josh Berkus

-- 
______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology      [EMAIL PROTECTED]
    and data management solutions       (415) 436-9166
   for law firms, small businesses       fax  436-0137
    and non-profit organizations.       pager 338-4078
                                        San Francisco

Reply via email to