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