Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Moving average function
Look at so-called analytic functions. Moving average would probably look
like this:
SELECT AVG(column) OVER (window definition) "Moving Average" FROM T;
where <window definition> defines a sliding window into T over which AVG() will be applied (RANGE or ROWS). These functions were introduced in Oracle8i 8.1.6. Reference and examples can be found in SQL Reference, and for a good overview and explanation of the feature I'd recommend Tom Kyte's "Expert one on one: Oracle" book.
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "gamaz" <gamaz_at_eathlink.net> wrote in message news:dYGA9.3631$Bh1.365036_at_newsread1.prod.itd.earthlink.net...Received on Thu Nov 14 2002 - 04:08:17 CST
> Could anybody tell me where I could find concept of moving average with
> regard to Oracle? Thanks.
>
>