Grouping by date range

Поиск
Список
Период
Сортировка
От Mat
Тема Grouping by date range
Дата
Msg-id 1061278450.3970.10.camel@Arakis
обсуждение исходный текст
Ответы Re: Grouping by date range  (Mike Mascari <mascarm@mascari.com>)
Re: Grouping by date range  (Alexander Litvinov <lan@ac-sw.com>)
Список pgsql-general
Hi,
I have a table with two column, date and data
I would like to do a set of queries to generate statistics on the data,
such as count(data) for month blocks and year blocks. What is the best
way to accomplish this?


dd/mm/yy
date    | data
---------------
01/01/01| 123
01/01/01| abc
02/01/01| def
03/03/01| hij

SOME QUERY ....

Year  | Count
-------------
01    | 3

I can see how to group by day - but how do i go about decreasing the
precision down to months/years.

Thanks...


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

Предыдущее
От: "Juris Krumins"
Дата:
Сообщение: Temporary tables
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: Example Database