Re: Histogram generator

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: Histogram generator
Дата
Msg-id 87F42982BF2B434F831FCEF4C45FC33E254080D5@EXCHANGE.corporate.connx.com
обсуждение исходный текст
Ответ на Histogram generator  (Patrick May <patrick.may@mac.com>)
Ответы Re: Histogram generator  (Patrick May <patrick.may@mac.com>)
Список pgsql-general
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Patrick May
> Sent: Tuesday, July 27, 2010 3:59 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Histogram generator
>
> Hi,
>
>     I have a table containing events with timestamps.  I would like
> to generate a histogram of the number of each type of event for each
> half-hour period from 8:00 am to 6:00 pm.  Are there any tools that
> will help me do this?

GROUP BY is essentially a histogram generator.
The age() function will give you an interval.

I am not sure if you want to combine half hour periods from different days with the same time or not (IOW are 8AM
Tuesdayand 8AM Wednesday supposed to be grouped together or not?) 

I guess that if you are more specific about exactly what you want you can get a better answer.  Your requirement is a
littlebit vague or ambiguous. 

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Must be owner of function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Incorrect FTS result with GIN index