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

Count rows group by time intervals

From: "Loredana Curugiu" <loredana(dot)curugiu(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Count rows group by time intervals
Date: 2007-05-09 12:07:37
Message-ID: 1c23c8e70705090507m717925b7rf380e1d925bbb33b@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Dear all,

I have the following table:

theme |   receiver        |           date
---------+----------------------+------------------------
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-27 00:00:00+00
 LIA   | +40741775622 |  2007-04-26 00:00:00+00
 LIA   | +40741775622 |  2007-04-26 00:00:00+00
 LIA   | +40741775622 |  2007-04-26 00:00:00+00
 LIA   | +40741775622 |  2007-04-26 00:00:00+00
 LIA   | +40741775622 |  2007-04-26 00:00:00+00
 LIA   | +40741775622 |  2007-04-25 00:00:00+00
 LIA   | +40741775622 |  2007-04-25 00:00:00+00
 LIA   | +40741775622 |  2007-04-25 00:00:00+00
 LIA   | +40741775622 |  2007-04-25 00:00:00+00
 LIA   | +40741775622 |  2007-04-25 00:00:00+00
 MIA   | +40741775622 | 2007-04-27 00:00:00+00
 MIA   | +40741775622 | 2007-04-27 00:00:00+00
 MIA   | +40741775622 | 2007-04-27 00:00:00+00
 MIA   | +40741775622 | 2007-04-27 00:00:00+00
 MIA   | +40741775622 |  2007-04-27 00:00:00+00
 MIA   | +40741775622 |  2007-05-09 00:00:00+00

I would like to count rows group by theme, receiver, and time intervals of
two days. I don't know how to start.

Hope that somebody could help me.

Responses

pgsql-novice by date

Next:From: Kevin HunterDate: 2007-05-09 13:39:21
Subject: Re: Count rows group by time intervals
Previous:From: Tom LaneDate: 2007-05-09 05:57:31
Subject: Re: Efficiency of CREATE TABLE AS

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