Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Michael Glaesemann
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

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Adrian Klaver
On Tuesday 14 September 2010 4:57:46 am Howard Cole 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 t

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Szymon Guz
On 14 September 2010 13:57, Howard Cole 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

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Bill Moran
In response to Howard Cole : > > 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 extrac

[GENERAL] Int to Interval conversion

2010-09-14 Thread Howard Cole
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