Search Postgresql Archives

Need query

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

 



Can anybody help me with query-

I have 3 tables- a,b,c

a has relation with b and b has relation with c
a does not have a relation with c 


I need to find top performing item in table 'a'. It is based on count. If more count, it is top performing. We can count only based on actions in table 'c'. I can put 'where' clause in table 'c' and find those values. I can't join table 'a' and 'c' as they don't have any relation. 


select b.top 
FROM b,c
WHERE c.action IN ('blah', 'blah', 'any values')  and b.id = c.id;

'top' in the query is a common column  in table 'a' named 'a_top'. We need to count column 'track' in table 'a' based on this information.

[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