Re: counts of groupings by date year-month

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: counts of groupings by date year-month
Дата
Msg-id 24305.1235771409@sss.pgh.pa.us
обсуждение исходный текст
Ответ на counts of groupings by date year-month  (Carol Cheung <cacheung@consumercontact.com>)
Список pgsql-sql
Carol Cheung <cacheung@consumercontact.com> writes:
> I tried something like
> SELECT to_char(access_date, 'YYYYMM') as year_month, count(year_month) 
> FROM temp GROUP BY year_month ORDER BY year_month;

The only problem in what you wrote was the illegal cross-reference
from one output column to another.  Just use count(*) instead.
        regards, tom lane


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: counts of groupings by date year-month
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: counts of groupings by date year-month