sql - Aggregate function over a given time interval -
my sql bit rusty , i'm having quite bit of difficulty problem. suppose have table timestamp column , number column. goal return result set containing average value arbitrarily chosen regular interval. so, example, if had following initial data, resulting output 5 minute interval follows: time value ------------------------------- ----- 06-jun-12 12.40.00.000000000 pm 2 06-jun-12 12.41.35.000000000 pm 3 06-jun-12 12.43.22.000000000 pm 4 06-jun-12 12.47.55.000000000 pm 5 06-jun-12 12.52.00.000000000 pm 2 06-jun-12 12.54.59.000000000 pm 3 06-jun-12 12.56.01.000000000 pm 4 output: start_time avg_value ------------------------------- --------- 06-jun-12 12.40.00.000000000 pm 3 06-jun-12 12.45.00.000000000 pm 5 06-jun-12 12.50.00.000000000 pm 2.5 06-jun-12 12.55.00.000000000 pm 4 note oracle database, oracle-specific solutions work fine. could, of course, done st...