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

Поиск
Список
Период
Сортировка
От Dorian Hoxha
Тема select top_countries and for each country, select top_cities in that country, in 1 query
Дата
Msg-id CANsFX05f5xTNvqvs47j8qathmXB28Xsfq5MbETZfF6krcaWZtA@mail.gmail.com
обсуждение исходный текст
Ответы Re: select top_countries and for each country, select top_cities in that country, in 1 query  (John McKown <john.archie.mckown@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: logfile character encoding
Следующее
От: Redoute
Дата:
Сообщение: Re: logfile character encoding