Re: sum of agreggates in one SELECT?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: sum of agreggates in one SELECT?
Дата
Msg-id 39C7AB0E.FA901CF8@agliodbs.com
обсуждение исходный текст
Ответ на sum of agreggates in one SELECT?  (Louis-David Mitterrand <cunctator@apartia.ch>)
Ответы Re: sum of agreggates in one SELECT?
Список pgsql-sql
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
informationtechnology      josh@agliodbs.com   and data management solutions       (415) 436-9166  for law firms, small
businesses      fax  436-0137   and non-profit organizations.       pager 338-4078                               San
Francisco


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Michael Richards"
Дата:
Сообщение: Repeatable reads
Следующее
От: John McKown
Дата:
Сообщение: Re: sum of agreggates in one SELECT?