Re: [SQL] Arithmetic operation on DATE

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: [SQL] Arithmetic operation on DATE
Дата
Msg-id 20010813121113.A1336@zf.jcu.cz
обсуждение исходный текст
Ответ на Arithmetic operation on DATE  ("macky" <macky@edsamail.com>)
Список pgsql-novice
On Mon, Aug 13, 2001 at 05:48:57PM +0800, macky wrote:
> is it possible to add a date datatype column to a number resulting to a
> date......
>
>
> theoretically it should do this,,,
>
> X is in months
>
> date + X = date
>
> -->  2001-08-20 + 6 = 2002-02-20

test=# select '2001-08-20'::date + '6months'::interval;
        ?column?
------------------------
 2002-02-20 00:00:00+01
(1 row)


 ..see docs about the "interval" datetype.

            Karel

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

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

Предыдущее
От: Christopher Sawtell
Дата:
Сообщение: Re: [SQL] Arithmetic operation on DATE
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: find and replace content