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 -> Windowing function - interval

Windowing function - interval

From: John Fava <jmfava_at_msn.com>
Date: 8 Aug 2003 07:27:33 -0700
Message-ID: <9f8b5944.0308080627.226e8089@posting.google.com>


I'm not sure if the below syntax does what I think it is doing. I want to look back 90 days from the "date_key" field and determine which is the minimum date for a give order_nbr and task. Does the "Interval '90' DAY" command actually look back 90 days? does it include the current date - if so, isn't that really 91 days? Appreciate your help! Thanks.

John Fava

select
order_nbr,
task,
date_key,
min(date_key) over
(PARTITION BY order_nbr, task

                    ORDER BY date_key asc range INTERVAL '90' DAY
preceding) as repeat
from
orders
group by
order_nbr,
task,
date_key Received on Fri Aug 08 2003 - 09:27:33 CDT

Original text of this message

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