Netezza get records last updated in last 5 minutes using a last modified time stamp column in the table?

837 views Asked by At

How to select records that updated in last 5 minutes using a last_modified_timestamp column in the table using current_date or current_timestamp function in Netezza?

1

There are 1 answers

0
Jeremy Fortune On BEST ANSWER

If you've installed the SQL extensions, then you can use minutes_between.

select 
  * 
from 
  table 
where 
  minutes_between(current_timestamp, last_modified_timestamp) < 5

If not, you can always use intervals.

select
  *
from
  table 
where 
  last_modified_timestamp > current_timestamp - '5 minute'::interval