Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> sliding aggregates
I have the following sql statement to calculate sliding aggregates.
But days between AI3_DATE-4 and AI3_DATE might not exactly equals 5(only
business days).
How can I specified where clause to meet the need?
select a.AI3_DATE, avg(b.AI3_INDEX)
from AI3 a, AI3 b
where (b.AI3_DATE between a.AI3_DATE-4 and a.AI3_DATE)
group by a.AI3_DATE
Received on Fri Oct 21 2005 - 00:42:29 CDT
![]() |
![]() |