Multiple aggs,sums in 1 query

Поиск
Список
Период
Сортировка
От Dorian Hoxha
Тема Multiple aggs,sums in 1 query
Дата
Msg-id CANsFX04074WyMDC=559fr8Ef_O9h1Dn=LL+HLX3hAHu5o8fApQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Multiple aggs,sums in 1 que
Список pgsql-general
I have: create table tbl (a,b,c,d,e,f,g,h);

And i need to select in 1 query ,or the most performant way:

top 5(a)
top 5(b)
top 5(c): for each top5(c): top 5(d)
count(f) GROUP BY f


I can make these in separate queries but that means that postgresql would read the table multiple-times?

Is it possible/doable/sane ?

Thanks

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

Предыдущее
От: Mike Kienenberger
Дата:
Сообщение: Browsing postgres database using the Eclipse QuantumDB plugin
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: PG replication across DataCenters