On Wed, 08 Jul 1998 09:04:10 -0700, Roger Tomas <tomasr@agcs.com>
wrote:
>Any clue as to how I might query a table containing a datetime
>field and perform statistical functions on rows grouped by half
>hour intervals?
Just a thought:
create temp table intervals
(
start_time datetime ... to minute,
end_time datetime ... to minute,
group_no smallint
) with no log;
insert into temp table values
(...,...,1)
for as many intervals as you need,
then:
select a.data, b.group
from mytable a, intervals b
where b.start_time<=a.datetime_field
and a.datetime_field<b.end_time
group by 1
Hope that helps,
Douglas Wilson