Search Postgresql Archives

Multiple aggs,sums in 1 query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux