Search Postgresql Archives

Re: timestamp differences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx

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

-- 
Adrian Klaver
aklaver@xxxxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux