Re: interval as hours or minutes ?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: interval as hours or minutes ?
Date: 2007-02-07 17:44:32
Message-ID: 20070207174432.GA24390@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Demel, Jeff 2007-02-07 19:46:42 metaphone and nysiis in postgres
Previous Message Bricklen Anderson 2007-02-07 17:33:40 Re: interval as hours or minutes ?