Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Newbie needs PL/SQL help
Does anyone have a general idea for a user created moving average
function ?
It would be starting with paramenters something like this
TEMPERATURE NUMBER(4,2)
CITY_SYMBOL VARCHAR2(10)
SEQ_NO seq_no of the CURRENT_ROW, where seq_no is taken
from the date
the moving average length such as 10 days, 20 days, etc.
the output of the moving avg funtion would the date selected and the
moving avg would be the sum
of the temperatures divided by the same number.
example.
select city, temperature,
mov_avg (city_symbol, seq_no, 20) as ma20
from city_temp
where city_symbol = 'AUSTIN';
any help please Received on Tue Apr 06 1999 - 10:46:05 CDT
![]() |
![]() |