Re: Count rows group by time intervals - Mailing list pgsql-novice

From Kevin Hunter
Subject Re: Count rows group by time intervals
Date
Msg-id 58BD097B-42B3-49D4-96DA-D7805F077C91@earlham.edu
Whole thread Raw
In response to Count rows group by time intervals  ("Loredana Curugiu" <loredana.curugiu@gmail.com>)
List pgsql-novice
At 8:07a -0400 on 09 May 2007, Loredana Curugiu wrote:
> I have the following table:
>
> theme |   receiver        |           date
> ---------+----------------------+------------------------
>  LIA   | +40741775622 |  2007-04-27 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-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.

Should get you started:

SELECT
    COUNT( * ),
    theme,
    receiver,
    date
FROM
    yourTable
GROUP BY
    theme,
    receiver,
    date
;

Kevin

pgsql-novice by date:

Previous
From: "Loredana Curugiu"
Date:
Subject: Count rows group by time intervals
Next
From: "Oliveiros Cristina"
Date:
Subject: Re: Count rows group by time intervals