| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера