Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Windowing function - interval
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' DAYpreceding) as repeat