| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: SQL for intervals
Tonkuma wrote:
> Bob Badour wrote: >
> > Same kind of thinking. But it is not necessary to use nested table > expression. > SELECT lbound.id > , CHAR(lbound.t,USA) "LowerBound" > , CHAR(MIN(ubound.t),USA) "UpperBound" > FROM W lbound > , W ubound > WHERE NOT EXISTS > (SELECT * > FROM W lower > WHERE lower.id = lbound.id > AND lower.t = lbound.t - 1 day > ) > AND ubound.id = lbound.id > AND ubound.t >= lbound.t > AND NOT EXISTS > (SELECT * > FROM W upper > WHERE upper.id = lbound.id > AND upper.t = ubound.t + 1 day > ) > GROUP BY > lbound.id, lbound.t
How is a table expression nested in the where clause any less nested than one in the from clause? Received on Tue Dec 12 2006 - 08:21:50 CST
![]() |
![]() |