Re: Why overlaps is not working

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: Why overlaps is not working
Дата
Msg-id eivta9$1kmd$1@news.hub.org
обсуждение исходный текст
Ответ на Re: Why overlaps is not working  (Matthias.Pitzl@izb.de)
Ответы Re: Why overlaps is not working  (Jorge Godoy <jgodoy@gmail.com>)
Список pgsql-general
>> WHERE (a,b) OVERLAPS (c,d)
>>
>> to
>>
>> WHERE (a-1,b+1) OVERLAPS (c-1,d+1)
>>
>> Will this give correct results ?
>
> It might give you false positives...
>
> 2006-11-30 -- 2006-12-05   AND    2006-12-06 -- 2006-12-15  (original) --
> FALSE
> 2006-11-29 -- 2006-12-06   AND    2006-12-05 -- 2006-12-16  (changed)  --
> TRUE

Jorge,

Thank you very much. Now I try to William Leite Ara�jo solution by replacing

WHERE (a,b) OVERLAPS (c,d)

with

WHERE  ( c BETWEEN a AND b ) OR  ( d BETWEEN a AND b )

Is this OK ?
This requires writing a and b expressions twice. How to avoid repeating
expressions ?

Andrus.



В списке pgsql-general по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Problem with pg_dump
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Can PostgreSQL notify a client that a trigger has fired?