Re: Grouping Results In 5 Minute Increments

From: Ted <ted_biggs_at_enron.net>
Date: 18 May 2001 07:55:26 -0700
Message-ID: <7854b9b7.0105180655.2a9e3c32_at_posting.google.com>


Thanks for all of your suggestions! We put our heads together and came up with this. It's fairly simple, and you can adjust the fraction to group by other subcomponents of a day....

  • 1/288 is the fraction of a day represented by 5 minutes minInterval := 1/288;

SELECT (((floor((tmstmp - trunc(tmstmp,
'DD'))/minInterval))*minInterval)+trunc(tmstmp, 'DD')), AVG(value)
from table
GROUP BY (((floor((tmstmp - trunc(tmstmp,
'DD'))/minInterval))*minInterval)+trunc(tmstmp, 'DD'));

Cheers!



Ted Received on Fri May 18 2001 - 16:55:26 CEST

Original text of this message