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
]
Subject
: select top_countries and for each country, select top_cities in that country, in 1 query
From
: Dorian Hoxha <
dorian.hoxha@xxxxxxxxx
>
Date
: Mon, 18 Aug 2014 16:28:23 +0200
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
]
Follow-Ups
:
Re: select top_countries and for each country, select top_cities in that country, in 1 query
From:
John McKown
Prev by Date:
Re: logfile character encoding
Next by Date:
Re: logfile character encoding
Previous by thread:
logfile character encoding
Next by thread:
Re: select top_countries and for each country, select top_cities in that country, in 1 query
Index(es):
Date
Thread
[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]