How to find avg() of sum()?

Поиск
Список
Период
Сортировка
От semi-ambivalent
Тема How to find avg() of sum()?
Дата
Msg-id 5849452c-f9d1-4855-a99b-3060f81732a3@u21g2000yqc.googlegroups.com
обсуждение исходный текст
Ответы Re: How to find avg() of sum()?
Список pgsql-general
I have some data fields that I have summed, grouped by a date field.
The sums are different. How can I then calculate the average value for
those sums? Everything I've tried errors out with something along the
lines of using agregates where I can't, or for using multiple values
where that is not allowed. I'm sure this can be done in one query,
without temp tables, but I don't know it and haven't found it yet in
the docs.

thanks,

sa

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Int64GetDatum
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: How to find avg() of sum()?