Subject RE: [firebird-support] Query using a range in where/having clause?
Author Steffen Heil
Hi

> > > ((ScheduleStart < UserStart) and (ScheduleEnd > UserEnd)) OR
> > > (ScheduleStart BETWEEN UserStart and UserEnd) OR (ScheduleEnd BETWEEN
> > > UserStart and UserEnd)

> > What about (ScheduleStart < UserEnd) and (ScheduleEnd > UserStart) ?

> Can you give me an example where I would need this condition and that it
wouldn't be covered by any of the 3 conditions that I mentioned?

I don't know if the optimizer can convert my query to the one above.
They are equivalent (- maybe up to <= instead of <). But my query could be
easier (and therefor faster) to compute with indices.

Regards,
Steffen