Re: Tabulate data incrementally - Mailing list pgsql-general

From Omar Eljumaily
Subject Re: Tabulate data incrementally
Date
Msg-id 45F05347.8090008@omnicode.com
Whole thread Raw
In response to Re: Tabulate data incrementally  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Thanks Alvaro.  That's good to know.  Actually I was spacing on the need
for this.  The date_trunc function with group by actually works for me.

select sum(amount), date_trunc('week', period_end) as dt from time_data
group by dt;


Alvaro Herrera wrote:
> Omar Eljumaily wrote:
>
>> Thanks Tom and Richard for the tip on date_trunc.  Is it possible in an
>> sql select statement to create an iterator?
>>
>
> Yes, use the generate_series() function.
>
>


pgsql-general by date:

Previous
From: araza@esri.com
Date:
Subject: Re: How to force planner to use GiST index?
Next
From: "Ted Byers"
Date:
Subject: Re: OT: Canadian Tax Database