At 5:53 PM +0100 10/25/99, Simon Gornall wrote:
>I'm pretty sure there's no way of doing this in one query, but
>just in case ....
>Say I have a table
>CREATE TABLE test (
> cron DATETIME,
> delay INTEGER);
>and in it, every minute, an entry is placed using NOW() for 'cron'
>and a particular value (100->1000) for 'delay'
>What I want to get is a time-averaged figure for 'delay', so I see
>the average delay over an hour.
>Is there any way of aggregating the 'delay' values over a time-period
>and doing it for all successive time periods in one go ?
>Perhaps I should wait until we get correlated sub-queries or stored
How about using GROUP BY on the cron values with the last three characters
chopped off to drop the seconds part, then use AVG() on the delay values?
Paul DuBois, paul@stripped