Search Postgresql Archives

Re: Interval Division Workaround Suggestions (sub-day intervals only)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 30, 2012 at 3:50 AM, David Johnston <polobo@xxxxxxxxx> wrote:
> Any suggestions on how to obtain the number of “X minute” intervals in “Y”
> where “Y” is always less than 24 hours?
>
> e.g., : ‘05:00:00’::interval / ’00:06:00’::interval => 50 (integer)

Turn them into integer seconds:

select date_part('epoch','05:00:00'::interval)/date_part('epoch','00:06:00'::interval);

ChrisA

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux