pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oliver Elphick <olly@lfix.co.uk>
Cc: Doppelganger <quadratini@sni.ph>
Cc: pgsql-sql@postgresql.org
Subject: Re: convert sum (interval) to seconds
Date: Tue, 03 Sep 2002 09:37:27 -0400
Message-ID: <5238.1031060247@sss.pgh.pa.us> (raw)
In-Reply-To: <1031051470.18322.12.camel@linda>
References: <1031049935.25016.14.camel@tiger-work.sni.ph>
	<1031051470.18322.12.camel@linda>

Oliver Elphick <olly@lfix.co.uk> writes:
> On Tue, 2002-09-03 at 11:45, Doppelganger wrote:
>> How can I convert sum(interval) to seconds?

> Here's one way;
    
>     junk=# select extract (minute from sum(if)) * 60 + extract (second
>     from sum(if)) from i;

EXTRACT(EPOCH FROM interval) is designed for this ...

			regards, tom lane



view thread (3+ messages)

Message-ID: <5238.1031060247@sss.pgh.pa.us>
Permalink:  ../5238.1031060247@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5238.1031060247@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, olly@lfix.co.uk, quadratini@sni.ph
  Subject: Re: convert sum (interval) to seconds
  In-Reply-To: <5238.1031060247@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox