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."
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
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера