Thread: 'group by day' possible?

'group by day' possible?

From
elwood@agouros.de (Konstantinos Agouros)
Date:
Hi,

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?

Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres

Re: 'group by day' possible?

From
Tom Lane
Date:
elwood@agouros.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