Re: to_char(interval) --- done?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: to_char(interval) --- done?
Дата
Msg-id 200303260850.36232.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: to_char(interval) --- done?  (Larry Rosenman <ler@lerctr.org>)
Ответы Re: to_char(interval) --- done?  (Larry Rosenman <ler@lerctr.org>)
Список pgsql-hackers
Larry,

> I had a need that should(!) be in the archives.  Just to reiterate my need:
>
> I input a contract length, in months, and wanted to get it back out as
> months.  There is no current way to do this, so I store it as an INT and
> concatenate the word months to do the
> date arithmetic.

What about EXTRACT(months FROM <interval_field>)?

This annoyingly wraps around if it's more than 12 months, but that was part of
my proposal ...

--
Josh Berkus
Aglio Database Solutions
San Francisco



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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: to_char(interval) --- done?
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: to_char(interval) --- done?