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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-sql by date

  From Date Subject
Next Message Larry Lennhoff 2004-10-25 03:18:55 Re: Create interval using column value?
Previous Message Tom Lane 2004-10-25 03:11:52 Re: Create interval using column value?