Search Postgresql Archives

select top_countries and for each country, select top_cities in that country, in 1 query

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

 



I have CREATE TABLE t (country text, city text);

I want to get with 1 query,

select count(country),country GROUP BY country ORDER BY count(country) DESC


And for each country, to get the same for cities.

Is it possible ?

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