Search Postgresql Archives

Re: Tabulate data incrementally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux