Re: [GENERAL] aggregate and order by

2007-12-07 Thread Sam Mason
On Thu, Dec 06, 2007 at 02:12:48PM -0600, Matthew Dennis wrote: > I want to create an aggregate that will give the average velocity (sum of > distance traveled / sum of elapsed time) from position and timestamps. How do you want to handle noisy data? If you want to handle it in any reasonable way

Re: [GENERAL] aggregate and order by

2007-12-06 Thread Gregory Stark
"Matthew Dennis" <[EMAIL PROTECTED]> writes: > So, my question is if I can have PostgreSQL honor order by clauses such as: > > select trip_id, avg_vel(position, pos_time) > from (select position, pos_time, trip_id from data order by pos_time) > sorted_data > > Would this in fact guarantee that

[GENERAL] aggregate and order by

2007-12-06 Thread Matthew Dennis
I want to create an aggregate that will give the average velocity (sum of distance traveled / sum of elapsed time) from position and timestamps. example: create table data(position integer, pos_time timestamp, trip_id integer); insert into data values(1, "time x", 1); insert into data values(2,