Skip site navigation (1) Skip section navigation (2)

Date math question

From: Kevin Kempter <kevink(at)consistentstate(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Date math question
Date: 2008-11-26 18:22:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hi All;

I have a table that contains 2 columns ts (a timestamp) and dursec (a float - 
number of seconds)

I want to insert the following into another table:

the ts (timestamp column) and a second date which is ts + dursec

I tried these select variations with no luck:

select ts, ts + interval dursec seconds from tmp2 limit 1;

select ts, ts + 'seconds' dursec from tmp2 limit 1;

Anyone know the correct syntax for this ?

Thanks in advance


pgsql-general by date

Next:From: Kevin KempterDate: 2008-11-26 18:54:33
Subject: Date math question
Previous:From: Steve CrawfordDate: 2008-11-26 18:05:14
Subject: Odd on-update inconsistency

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group