X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A2582D1B193 for ; Tue, 1 Jun 2004 10:58:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20839-08 for ; Tue, 1 Jun 2004 10:58:03 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 37D51D1B18C for ; Tue, 1 Jun 2004 10:57:58 -0300 (ADT) Received: (qmail 24517 invoked by uid 500); 1 Jun 2004 14:03:34 -0000 Date: Tue, 1 Jun 2004 09:03:34 -0500 From: Bruno Wolff III To: Willem de Jong Cc: pgsql-sql@postgresql.org Subject: Re: sum ( time) problem Message-ID: <20040601140334.GA24188@wolff.to> Mail-Followup-To: Willem de Jong , pgsql-sql@postgresql.org References: <1084406549.228484@seven.kulnet.kuleuven.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/2 X-Sequence-Number: 17947 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.