Re: adding times togeather - Mailing list pgsql-general

From scott.marlowe
Subject Re: adding times togeather
Date
Msg-id Pine.LNX.4.33.0304281639070.14672-100000@css120.ihs.com
Whole thread Raw
In response to Re: adding times togeather  (ed despard <despareg@clarkson.edu>)
List pgsql-general
On Mon, 28 Apr 2003, ed despard wrote:

> what i have is two columns that represent the times for sections of a
> race, so i have column A that is say 0:20:23 and i have column B that
> is 0:21:45 and i want to have a column that is A+B where that would be
> 0:42:18 in this case.

Store them as intervals and you can do that pretty easily:

create table th (n interval, p interval);
CREATE TABLE
marl8412=# insert into th values ('00:02:23','00:03:43');
INSERT 4505763 1
marl8412=# select n+p as time from th;
  time
----------
 00:06:06


pgsql-general by date:

Previous
From: ed despard
Date:
Subject: Re: adding times togeather
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: adding times togeather