Re: 'group by day' possible?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: elwood(at)agouros(dot)de (Konstantinos Agouros)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 'group by day' possible?
Date: 2001-08-02 23:10:31
Message-ID: 14584.996793831@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

elwood(at)agouros(dot)de (Konstantinos Agouros) writes:
> I have a table where I enter some data with a full flexed datetime. Is there
> a _simple_ aggregate that I get the sum of entries for each day?

Maybe I'm missing something, but what's wrong with

select sum(datacol) from table group by date(timestampcol);

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Susan Lane 2001-08-02 23:37:16 Pgadmin
Previous Message Tom Lane 2001-08-02 22:59:46 Re: Timestamp with time zone issue