Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6C36B475A9B for ; Tue, 3 Sep 2002 06:45:29 -0400 (EDT) Received: from ns.sni.ph (unknown [202.57.48.9]) by postgresql.org (Postfix) with ESMTP id F11FD475A69 for ; Tue, 3 Sep 2002 06:45:25 -0400 (EDT) Received: (from root@localhost) by ns.sni.ph (8.11.6/8.11.6) id g83AjNR22795 for pgsql-sql@postgresql.org; Tue, 3 Sep 2002 18:45:23 +0800 (PHT) Received: from tiger-work.sni.ph ([202.57.48.24]) by ns.sni.ph (8.11.6/8.11.6) with ESMTP id g83AjKM22730 for ; Tue, 3 Sep 2002 18:45:22 +0800 (PHT) Subject: convert sum (interval) to seconds From: Doppelganger To: pgsql-sql@postgresql.org X-scanner: scanned by SNI 1.0.10 - (http://www.sni.ph) Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 03 Sep 2002 18:45:33 +0800 Message-Id: <1031049935.25016.14.camel@tiger-work.sni.ph> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/5 X-Sequence-Number: 9282 How can I convert sum(interval) to seconds? select sum(interval_field) from tablename where condition=condition; ID | LOGIN | INTERVAL -------------------------- 1 | JOHN | 00:00:18 2 | JOHN | 00:45:10 If I say, select sum(interval) from tablename where login='john'; it will give me 00:45:28 (That's 45 mins, and 28 secs). How can I convert that to seconds? Can I possibly do it in just one query? Thank you