Re: Retrieving INTERVAL as float hours?

From: "Alex Bolenok" <abolen(at)chat(dot)ru>
To: "Ken Causey" <ken(at)premiernet(dot)net>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Retrieving INTERVAL as float hours?
Date: 2000-07-12 15:06:59
Message-ID: 003e01bfec12$d69b6d60$df02a8c0@artey.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

----- Original Message -----
From: "Ken Causey" <ken(at)premiernet(dot)net>
To: <pgsql-general(at)postgresql(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Philip Warner 2000-07-12 15:11:04 RE: RE: [HACKERS] pg_dump & blobs - editable dump?
Previous Message Brook Milligan 2000-07-12 14:56:49 Re: RE: [HACKERS] pg_dump & blobs - editable dump?