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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -