MySQL Forums
Forum List  »  Newbie

No Window Fns in MySQL?
Posted by: Philip Costa
Date: January 13, 2012 07:46PM


I'm a newbie dB user trying to take a table that has date (column a) and value (b) columns, and create a new table that has the same date and value columns but also a new value column (c) that, for any row, has the value that is the average of the values in (b) for the previous x number of days.

Googling around turned up 'window functions' in other versions of SQL (Oracle, Postgre) that seem to be able to do this, but nothing in MySQL.

Is there any way to do this in MySQL?

I know 'group by' exists but it requires a distinct entry across each of the groups of rows I want to average over, which doesn't work in any way i can see with a rolling window.

Appreciate any help.


Options: ReplyQuote

Written By
No Window Fns in MySQL?
January 13, 2012 07:46PM
January 15, 2012 12:38PM
January 17, 2012 01:08PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.