Search Postgresql Archives

Interval Rounding

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

 



Hello,
I have a table that contains a user's response and a timestamp at which it was last updated. I want to query for this response, and the amount of time that has elapsed since, rounded to the nearest unit (e.g. minutes, days, months, etc). I am using:

SELECT NOW() - change_time
FROM ...

to get the interval, and am attempting to use either EXTRACT() or DATE_PART() to get the appropriate value, but the interval doesn't contain any unit higher than days.

Any thoughts on how I could accomplish this?  Thanks in advance

Mike Ginsburg
Collaborative Fusion, Inc.
mginsburg@xxxxxxxxxxxxxxxxxxxxxxx



[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