Re: Int to Interval conversion

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Howard Cole <howardnews(at)selestial(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Int to Interval conversion
Date: 2010-09-14 13:41:12
Message-ID: 1092B047-C86F-43F5-B83C-D3869E56D944@seespotcode.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 14, 2010, at 7:57 , Howard Cole wrote:

> 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?

test=# SELECT 1440 * INTERVAL '1 minute';
?column?
----------
24:00:00
(1 row)

Michael Glaesemann
grzm seespotcode net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message adi hirschtein 2010-09-14 13:59:29 Re: Monitoring Object access
Previous Message Adrian Klaver 2010-09-14 13:34:24 Re: Int to Interval conversion