Re: Dynamic Query for System functions - now()

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Dynamic Query for System functions - now()
Дата
Msg-id 20031110072842.K16647@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Dynamic Query for System functions - now()  ("Kumar" <sgnerd@yahoo.com.sg>)
Список pgsql-sql
On Mon, 10 Nov 2003, Kumar wrote:

> select now()+ interval'1 month';  -- This is working fine.
>
> I wanna dynamically assign the interval number. i,e --> select now()+
> interval'n month';

If n is an integer, I'd suggest something likeselect now() + n * interval '1 month';
rather than messing around with the text of the interval literal.



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

Предыдущее
От: "George Weaver"
Дата:
Сообщение: Re: Dynamic Query for System functions - now()
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: transaction processing after error in statement