X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 35C0DD1B182 for ; Mon, 7 Jun 2004 03:18:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85907-04 for ; Mon, 7 Jun 2004 06:18:16 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 7BB46D1B193 for ; Mon, 7 Jun 2004 03:18:10 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i576I5DW013111 for ; Mon, 7 Jun 2004 06:18:05 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i5769WRK011448 for pgsql-sql@postgresql.org; Mon, 7 Jun 2004 06:09:32 GMT From: Willem de Jong X-Newsgroups: comp.databases.postgresql.sql Subject: Re: sum ( time) problem Date: Mon, 7 Jun 2004 06:09:32 +0000 (UTC) Organization: DNA Services B.V. Lines: 27 Message-ID: References: <1084406549.228484@seven.kulnet.kuleuven.ac.be> <20040601140334.GA24188@wolff.to> X-Complaints-To: usenet@news.hub.org User-Agent: Xnews/5.04.25 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/102 X-Sequence-Number: 18047 I'm afraid it is the only solution... Thanks for reply bruno@wolff.to (Bruno Wolff III) wrote in news:20040601140334.GA24188 @wolff.to: > On Thu, May 27, 2004 at 11:14:58 +0000, > Willem de Jong 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. > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > >