Re: Tabulate data incrementally

From: Omar Eljumaily <omar2(at)omnicode(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Tabulate data incrementally
Date: 2007-03-08 18:17:43
Message-ID: 45F05347.8090008@omnicode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ted Byers 2007-03-08 18:18:37 Re: OT: Canadian Tax Database
Previous Message araza 2007-03-08 17:54:40 Re: How to force planner to use GiST index?