Re: sum of agreggates in one SELECT?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sum of agreggates in one SELECT?
Дата
Msg-id 7125.969384468@sss.pgh.pa.us
обсуждение исходный текст
Ответ на sum of agreggates in one SELECT?  (Louis-David Mitterrand <cunctator@apartia.ch>)
Список pgsql-sql
Louis-David Mitterrand <cunctator@apartia.ch> writes:
> Now I would like to sum() all results from the quantity column and
> return it with one SELECT statement. Is that possible?

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...
        regards, tom lane


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

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