Re: [GENERAL] Selecting between dates

Поиск
Список
Период
Сортировка
От Aaron Seigo
Тема Re: [GENERAL] Selecting between dates
Дата
Msg-id 3.0.6.32.19990810155318.00799c90@gtv.ca
обсуждение исходный текст
Ответ на Selecting between dates  (Wim Kerkhoff <wim@netmaster.ca>)
Ответы Re: [GENERAL] Selecting between dates  (Wim Kerkhoff <wim@netmaster.ca>)
Список pgsql-general
hi wim..

>select * from company where created
>is between (lastpaid + 14 days) and (created + 28 days);

assuming that lastpaid and created are dates, pgsql will handle the
addition quite nicely for you... as examples:

test=> select '4-1-1999'::date + 7;
  ?column?
----------
04-08-1999
(1 row)

test=> select '4-26-1999'::date + 7;
  ?column?
----------
05-03-1999

test=> select '12-26-1999'::date + 7;
  ?column?
----------
01-02-2000
(1 row)

Aaron J. Seigo
Systems Analyst/Administrator

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

Предыдущее
От: Bill Garrett
Дата:
Сообщение: anomalous, persistent high loads with postgresql 6.5.1
Следующее
От: Wim Kerkhoff
Дата:
Сообщение: Re: [GENERAL] Selecting between dates