RAJESH RAJESH - 5 months ago 62
SQL Question

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

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?

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 
Comments