Omar Eljumaily <omar2@xxxxxxxxxxxx> writes: > Ted, my reason for asking the question that I believe precipitated this thread > was that I wanted a single sql statement that aggregated time data by week. > Yes, I could do the aggregation subsequently in my own client side code, but > it's easier and less error prone to have it done by the server. If you work closer to the data you have more efficiency. To do what you want you can write a function using plpgsql -- I've posted some ideas -- and that is not hard at all. But if there was something to make it easier to write this it would be great ;-) -- Jorge Godoy <jgodoy@xxxxxxxxx>