postgresql query with time difference -
i have table structure follows
id name point last_updated refresh_frequency 1 'abc' 100 2015-08-28 01:00:00 24
last_updated
datetime field , refresh_frequency
int
i want rows having last_updated value before refresh_frequency (in hours) current time, how write query this?
select * tablename last_updated < now() - refresh_frequency * interval '1 hour';
Comments
Post a Comment