From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: interval as hours or minutes ?
Date: Wed, 7 Feb 2007 18:44:32 +0100
Message-ID: <20070207174432.GA24390@a-kretschmer.de> (raw)
In-Reply-To: <200702071903.35126.aarni@kymi.com>
References: <200702071903.35126.aarni@kymi.com>
am Wed, dem 07.02.2007, um 19:03:35 +0200 mailte Aarni Ruuhimäki folgendes:
> Hi all,
>
> Could anyone please tell an easy way to get total hours or minutes from an
> interval ?
>
> SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times WHERE
> user_id = 1;
Perhaps. You can, for instance, with extract(epoch from stop_date_time)
retrieve the number of seconds and work with this.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
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: andreas.kretschmer@schollglas.com
Subject: Re: interval as hours or minutes ?
In-Reply-To: <20070207174432.GA24390@a-kretschmer.de>
* 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