Sum of events over an interval; how?

From: S Dawalt <shane(dot)dawalt(at)wright(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Sum of events over an interval; how?
Date: 2002-02-18 19:32:08
Message-ID: 007d01c1b8b2$f4326f40$23b16c82@HP0E2E6GKYFJS4
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a number of records having a timestamp when something happened. I am trying to find the number of events (records) that happened per minute over an hour timespan. I just cannot figure out how to do this. Maybe it's not possible? Would a plpgsql function be a good idea so that the number of front-end/back-end requests is small? I'm looking for some output (or maybe temp table) of:

Time Count
2/17/2002 22:00:00 4
2/17/2002 22:01:00 7
2/17/2002 22:02:00 14
....

Any help, even "Can't be done" is appreciated.

Shane A. Dawalt
********************************************
Network Engineer
Wright State University
Dayton, OH 45435 USA
Phone: 937-775-4089
Email: shane(dot)dawalt(at)wright(dot)edu

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Castle 2002-02-18 20:15:01 Re: Work Around for Oracle Context Indexes?
Previous Message Eric Peters 2002-02-18 19:07:41 can you do a for loop on a function call in PL/PGSQL?