Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Moving Average
I have a base table with the 2 columns, IMSI and Date. I would like to
calculate a moving average of distinct IMSIs in a given window. I have
developed my query to this point but am receiving an "ORDER BY not
allowed here" error when I try to execute the query.
select ir_date, count(distinct imsi) OVER (ORDER BY ir_date ASC RANGE 5
PRECEDING)
from ir_daily_unique
where ir_date between to_date('03-AUG-06','DD-MON-YY') and
to_date('15-AUG-06','DD-MON-YY')
group by ir_date
Received on Sun Sep 03 2006 - 05:30:38 CDT
![]() |
![]() |