Re: Retrieving INTERVAL as float hours? - Mailing list pgsql-general

From Alex Bolenok
Subject Re: Retrieving INTERVAL as float hours?
Date
Msg-id 003e01bfec12$d69b6d60$df02a8c0@artey.ru
Whole thread Raw
In response to Retrieving INTERVAL as float hours?  (Ken Causey <ken@premiernet.net>)
List pgsql-general
----- Original Message -----
From: "Ken Causey" <ken@premiernet.net>
To: <pgsql-general@postgresql.org>
Sent: Wednesday, July 12, 2000 6:14 PM
Subject: [GENERAL] Retrieving INTERVAL as float hours?


> This may be a stupid question, and feel free to RTFM me, but please
> specify the manual/book as I can't seem to find this.  I want
> to retrieve an INTERVAL (the sum of INTERVALS actually) as a float
> hour.  In other words if I normally get an output like
>
> @ 2 hours 30 minutes
>
> I would like
>
> 2.5
>
> Thanks in advance for all help.
>
> Ken Causey
>
>

ikar=# SELECT DATE_PART('epoch', '2 hours 30 minutes'::interval) / 3600;
 ?column?
----------
      2.5
(1 row)

Alex Bolenok


pgsql-general by date:

Previous
From: Brook Milligan
Date:
Subject: Re: RE: [HACKERS] pg_dump & blobs - editable dump?
Next
From: Philip Warner
Date:
Subject: RE: RE: [HACKERS] pg_dump & blobs - editable dump?