| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: SQL for intervals
Lennart wrote:
[...]
>
> 3. Determine upper bound for each interval
>
> ), upper (id, min_date, max_date) as (
> select w.id, w.t, min(c.t) - 1 day from compl c, w
> where c.t > w.t
> group by w.id, w.t
> )
Grmpf, add the predicate c.id = w.id, i.e.
where c.t > w.t and c.id = w.id
In addition to my nonexistent explanation before, what we do here is to find the least complement - 1 day that is bigger than t for current row. That is, the maximum t in this interval.
/Lennart Received on Sat Dec 02 2006 - 07:35:55 CST
![]() |
![]() |