Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> sliding aggregates

sliding aggregates

From: 001 <001_at_ms8.url.com.tw>
Date: Fri, 21 Oct 2005 13:42:29 +0800
Message-ID: <dj9vel$lga$1@jupiter.ttn.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US