Re: sum ( time) problem

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Willem de Jong <Willumpie(at)xs4all(dot)nl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: sum ( time) problem
Date: 2004-06-01 14:03:34
Message-ID: 20040601140334.GA24188@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, May 27, 2004 at 11:14:58 +0000,
Willem de Jong <Willumpie(at)xs4all(dot)nl> wrote:
> >>
> >> If i do a sum(time) the result is like this '1 day 18:00:00'. But i'd
> >> like to get a result like this '42:00:00'.
> >>
> >> How can i realise is by a query?

You can do something like the following: (not completely tested)
select extract(epoch from sum(time))/3600 || ':' ||
extract(minutes from sum(time)) || ':' ||
extract(seconds from sum(time));

I am not sure if the above will work right for negative intervals.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-06-01 14:25:41 Re: Schemata & User-Defined-Type casting issues
Previous Message Chris Gamache 2004-06-01 14:00:45 Schemata & User-Defined-Type casting issues