Re: Convert INT to INTERVAL?

Поиск
Список
Период
Сортировка
От Michael Chaney
Тема Re: Convert INT to INTERVAL?
Дата
Msg-id 20040227180705.GC8807@michaelchaney.com
обсуждение исходный текст
Ответ на Convert INT to INTERVAL?  (Brian Knox <laotse@aol.net>)
Список pgsql-sql
On Fri, Feb 27, 2004 at 11:54:04AM -0500, Brian Knox wrote:
> Is it possible within pl/pgsql, to convert an integer to an interval in 
> months? IE, if num_months is an INT set to 48, can it be converted to an 
> interval?

select (1||' months')::interval;

You should be able to replace the "1" with your integer variable.

Michael
-- 
Michael Darrin Chaney
mdchaney@michaelchaney.com
http://www.michaelchaney.com/


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Convert INT to INTERVAL?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Convert INT to INTERVAL?