Re: Dynamic Query for System functions - now()

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Cc: Kumar <sgnerd(at)yahoo(dot)com(dot)sg>
Subject: Re: Dynamic Query for System functions - now()
Date: 2003-11-10 19:12:49
Message-ID: 3FAFE331.2040308@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Kumar wrote:

> Dear Friends,
>
> I am using PostgreSQL 7.3.4 Server on RH Linux 7.2. I am trying to
> generate a dynamic query to fetch the next month interval.
>
> select now()+ interval'1 month'; -- This is working fine.
>
> I wanna dynamically assign the interval number. i,e --> select now()+
> interval'n month';

What about:

select now() + n * '1 month'::intervall;

Regards
Gaetano Mendola

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rod Taylor 2003-11-10 19:45:05 Re: transaction processing after error in statement
Previous Message Rod Taylor 2003-11-10 18:56:29 Re: transaction processing after error in statement