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

Re: Create interval using column value?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Larry Lennhoff <llennhoff-postgres(at)pexicom(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create interval using column value?
Date: 2004-10-25 03:13:42
Message-ID: DFDD31D0-2633-11D9-87A8-000A95C88220@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Oct 25, 2004, at 11:54 AM, Larry Lennhoff wrote:

> SELECT A.id FROM A JOIN B ON (join_col) WHERE built_on < now() - 
> interval 'build_interval seconds';

It would help to see the error you're getting, but I suspect it has 
something to do with the fact that you're quoting 'build_interval'. Try 
something like WHERE built_on < current_timestamp - build_interval *  
INTERVAL '0.001 second';
(btw, current_timestamp is the SQL standard for now() )

Regards,

Michael Glaesemann
grzm myrealbox com


In response to

pgsql-sql by date

Next:From: Larry LennhoffDate: 2004-10-25 03:18:55
Subject: Re: Create interval using column value?
Previous:From: Tom LaneDate: 2004-10-25 03:11:52
Subject: Re: Create interval using column value?

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