tricky date manipulations?
tricky date manipulations?
От:
Alfred Perlstein <bright@wintelcom.net>
Дата:
I'm trying to accomplish some things where some tricky manipulation of dates would be very helpful. I'm wondering if it's possible to: select from a table several records and group by a date column. The idea is that I have a table with rows for each hour, I'd like to be able to select a date range (let's say a month) and perform sums on some of the columns however "group by" the day, so that I get rows returned that are the sum of all the day's statistics for several days. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk."
Re: tricky date manipulations?
От:
Frank Bax <fbax@execulink.com>
Дата:
At 05:35 PM 4/06/00 -0700, you wrote: >select from a table several records and group by a date column. just cast your datetime or timestamp (hour) field into a date... select hour::date, sum(whatever) from table group by hour::date; Frank