Re: interval +variable

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: interval +variable
Дата
Msg-id 20050309091736.GA29736@winnie.fuhr.org
обсуждение исходный текст
Ответ на interval +variable  ("Fatih Cerit" <fatih@intersan.com.tr>)
Список pgsql-sql
On Wed, Mar 09, 2005 at 10:58:05AM +0200, Fatih Cerit wrote:

> Is there anyone at there who knows howto use dateadd in pgsql. I have a 
> problem in my function that is like this ;
> 
> Select into futuredate now() + interval '30 days';  <- this is ok
> but how can I use a variable intead of '30 days'    :(

Are you looking for something like this?

ndays := 30;
SELECT INTO futuredate now() + ndays * interval'1 day';

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: "Fatih Cerit"
Дата:
Сообщение: interval +variable
Следующее
От: Kenneth Gonsalves
Дата:
Сообщение: Re: datestyle setting