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.