I have the table like below
id timestamp speed 1 11:00:01 100 2 11:05:01 110 3 11:10:01 90 4 11:15 :01 80
I need to calcu
Or slotting neatly between GL's two answers (performancewise anyway)...
SELECT x.*, AVG(y.speed) avg FROM my_table x JOIN my_table y ON y.id <= x.id GROUP BY x.id;