Hey everyone. Here is my situation... I need to craft a sql query against a postgresql server that will return all records created within the past 5 minutes, rounded down to the lowest minute. So if cron kicks the query off at 12:05:25.000, it needs to query all records created since 12:00:00.000. So I guess I really have two issues.
I know using
DATE_SUB(now(),INTERVAL 5 MINUTE)
works in mysql - is there an equivalent in postgresql? I couldn't find any mention of it in the date/time functions documentation here.
Second, how do I tell it to round down to the minute (ignore seconds) for the 5 minute interval?
Any advice would be appreciated.