MySQL Forums :: Newbie :: No Window Fns in MySQL?


Advanced Search

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

Hello-

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.

Philip

Options: ReplyQuote


Subject Written By Posted
No Window Fns in MySQL? Philip Costa 01/13/2012 07:46PM
Re: No Window Fns in MySQL? Rick James 01/15/2012 12:38PM
Re: No Window Fns in MySQL? Philip Costa 01/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.