using interval in a query with a column for the interval value?

Поиск
Список
Период
Сортировка
От Walker, Jed S
Тема using interval in a query with a column for the interval value?
Дата
Msg-id 4A59B6AA01F1874283EA66C976ED51FC466426@COENGEXCMB01.cable.comcast.com
обсуждение исходный текст
Ответы Re: using interval in a query with a column for the interval value?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice

(Im sending this again, because the original somehow got split into two posts)

I am writing a script and I need to output results to a file based on a table where the data to select is based on a ‘last’ date and an ‘interval’.

Essentially

Name

Last_date

Interval

Jed     2005-06-02      30

Tom     2005-08-02      30

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.

How do I make this work?

Thanks,

Jed

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: change varchar(10) to varchar()
Следующее
От: "Walker, Jed S"
Дата:
Сообщение: Handling Daylight Savings