Skip site navigation (1) Skip section navigation (2)

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:59:05
Message-ID: 200812281359.05431.aklaver@comcast.net (view raw or flat)
Thread:
Lists: pgsql-general
On Sunday 28 December 2008 1:53:30 pm Adrian Klaver wrote:
> 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

Coffee refill
Should be:
 select * from foo where ts_fld > now() - interval '10 min'

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

In response to

pgsql-general by date

Next:From: Greg SmithDate: 2008-12-28 22:04:47
Subject: Re: Bgwriter and pg_stat_bgwriter.buffers_clean aspects
Previous:From: Adrian KlaverDate: 2008-12-28 21:53:30
Subject: Re: timestamp differences

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group