Search Postgresql Archives

Re: Histogram generator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-
> owner@xxxxxxxxxxxxxx] On Behalf Of Patrick May
> Sent: Tuesday, July 27, 2010 3:59 PM
> To: pgsql-general@xxxxxxxxxxxxxx
> Subject:  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 Tuesday and 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 little bit vague or ambiguous.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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]
  Powered by Linux