Re: timestamp differences

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk>
Subject: Re: timestamp differences
Date: 2008-12-28 21:53:30
Message-ID: 200812281353.31139.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 28 December 2008 1:40:28 pm Garry Saddington wrote:
> I have a timestamp column that I want to compare with current timestamp.
> I want to get all rows that are less than 10 minutes old. I have searched
> but can not find how to do this, any pointers?
> regards
> Garry

select * from foo where ts_fld > now() - 'interval 10 min'

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2008-12-28 21:59:05 Re: timestamp differences
Previous Message Garry Saddington 2008-12-28 21:40:28 timestamp differences