Re: Why overlaps is not working

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Why overlaps is not working
Дата
Msg-id 20061109140533.GC27554@a-kretschmer.de
обсуждение исходный текст
Ответ на Why overlaps is not working  ("Andrus" <eetasoft@online.ee>)
Список pgsql-general
am  Thu, dem 09.11.2006, um 15:46:50 +0200 mailte Andrus folgendes:
> set datestyle to iso,iso;
>
> select 1 where ('2006-10-31'::date, '9999-12-31'::date) OVERLAPS
>    ('2006-10-16'::DATE, '2006-10-31':: DATE)
>
>
> does not return any rows.
>
> Why ?
> How to make overlaps to return correct result?

Because they don't overlaps.

Example:

test=*# select ('2006-10-01'::date, '2006-10-11'::date) OVERLAPS ('2006-10-11'::DATE, '2006-10-20'::DATE);
 overlaps
----------
 f
(1 row)

test=*# select ('2006-10-01'::date, '2006-10-12'::date) OVERLAPS ('2006-10-11'::DATE, '2006-10-20'::DATE);
 overlaps
----------
 t
(1 row)


Your date-range don't overlap, because the 2nd ends '2006-10-31' and the other
begin with '2006-10-31'. And your query can't return anything because the where-condition
returns false.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Why overlaps is not working
Следующее
От: "Andrus"
Дата:
Сообщение: Re: Why overlaps is not working