Jochem van Dieten wrote:
> DURETTE, STEVEN J (AIT) wrote:
>
>>The problem with your change is that it won't pick up partial overlays.
>
> Just run it. We actually need to test it twice, proving that the
> negator is the same as the operator is too much work for now:

On second thought, the proof that I am not selecting too few
records is pretty easy.

Let A be an interval from Ai to Aj: Ai < Aj.
Let B be an interval from Bi to Bj: Bi < Bj.

For A and B to overlap, there must be a point in time X that is
in both the interval A and the interval B. Ergo:
Ai < X < Aj   ^   Bi < X < Bj

From which follows:
Ai < X < Bj   ^   Bi < X < Aj

We can leave out X:
Ai < Bj   ^   Bi < Aj

And this can be written as:
Ai < Bj   ^   Aj > Bi

This is the exact condition I was testing for in the query. I
might be getting too many results back, but not too few.

Jochem

--
Who needs virtual reality
if you can just dream?
     - Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to