Re: adding years to a date field

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: adding years to a date field
Дата
Msg-id 6F852C30-7A85-4AF4-8BA3-A9596BCCB89F@seespotcode.net
обсуждение исходный текст
Ответ на Re: adding years to a date field  (Christine Penner <chris@fp2.ca>)
Список pgsql-general
On Apr 6, 2011, at 12:18, Christine Penner wrote:

> This still gave me a sytax error. The other suggestion to multiply the interval field by 1 year also gave me a syntax
error.

What was the error? And it's preferable to do multiply rather than do the equivalent of an eval on some string.


select (current_timestamp at time zone 'utc' + CAST(3 AS SMALLINT) * interval '1 year');
          ?column?
----------------------------
 2014-04-06 16:27:30.273562
(1 row)

Michael Glaesemann
grzm seespotcode net




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

Предыдущее
От: "Davenport, Julie"
Дата:
Сообщение: Re: temp tables not dropping at end of script
Следующее
От: Christine Penner
Дата:
Сообщение: Re: adding years to a date field