Search Postgresql Archives

cast time interval to seconds

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

 



Hi, I have two columns start_time & stop_time declared as "TIME". I'd like to compute the difference between the two times in seconds, all in db:

SELECT
  (CAST(stop_time AS SECONDS) + 86400 - CAST(start_time AS SECONDS))
  % 86400;

Unfortunately AS SECONDS causes parse error. Any hints? Thanks.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

[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