Skip site navigation (1) Skip section navigation (2)

How to query for Interval

From: "Vishal Kashyap " <vishalonlist(at)gmail(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: How to query for Interval
Date: 2006-04-11 20:53:12
Message-ID: 77b69d210604111353o7b7213d4q604fe21212507826@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,


I have a table with time stamps in it . These timestamp represent a event count.
I just wanted to know how could I query such that I get a count of
event per hour.

Table structure is

my_table(id serial, time_event timestamp,event varchar(200));

I want to do something like
select count(id) from  my_table where time_event in (every 1 hour);

Any pointers / help would be appreciated


--
With Best Regards,
Vishal Kashyap.
http://www.vishal.net.in

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2006-04-11 20:54:06
Subject: Re: Indexes slower when used in decending vs. ascending order?
Previous:From: Alasdair YoungDate: 2006-04-11 20:40:52
Subject: Re: Indexes slower when used in decending vs. ascending

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group