Re: using interval in a query with a column for the interval value? - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: using interval in a query with a column for the interval value?
Date
Msg-id 20050810190053.GA7189@wolff.to
Whole thread Raw
In response to using interval in a query with a column for the interval value?  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
List pgsql-novice
On Thu, Aug 04, 2005 at 09:52:50 -0600,
  "Walker, Jed S" <Jed_Walker@cable.comcast.com> wrote:
>
> Select name
> From table1
> Where last_date < now() - [[interval days]];
>
> The interval days part is what is stumping me I need to say "now() -
> interval '30 days'" but I need to use the interval column.

Use something like:
Where last_date < now() - Interval * '1 day'::interval

pgsql-novice by date:

Previous
From: Alexander Kotelnikov
Date:
Subject: Re: Transaction blocks
Next
From: Michael Fuhr
Date:
Subject: Re: Transaction blocks