Re: Int to Interval conversion

Поиск
Список
Период
Сортировка
От Szymon Guz
Тема Re: Int to Interval conversion
Дата
Msg-id AANLkTikha4=M=0Y=sr-O12Ky6V44CVEnVUrW0o+M26f+@mail.gmail.com
обсуждение исходный текст
Ответ на Int to Interval conversion  (Howard Cole <howardnews@selestial.com>)
Список pgsql-general


On 14 September 2010 13:57, Howard Cole <howardnews@selestial.com> wrote:
 Hi everyone,

I have a table with a duration field, stored as an Integer. How can I retrieve this from the table as an Interval type?

E.g.

create table test (test_id serial primary key, time_in_minutes int);
insert into test values (1440);

Now how do I extract that as 24:00:00::interval in a query?


select 1440 * interval '1 minute'; 

regards
Szymon Guz

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Int to Interval conversion
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Int to Interval conversion