pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Cc: Kumar <sgnerd@yahoo.com.sg>
Subject: Re: Dynamic Query for System functions - now()
Date: Mon, 10 Nov 2003 20:12:49 +0100
Message-ID: <3FAFE331.2040308@bigfoot.com> (raw)
In-Reply-To: <017701c3a75a$0e3e6050$7502a8c0@hdsc.com>
References: <017701c3a75a$0e3e6050$7502a8c0@hdsc.com>

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




view thread (8+ messages)

Message-ID: <3FAFE331.2040308@bigfoot.com>
Permalink:  ../3FAFE331.2040308@bigfoot.com/
Also on:    postgresql.org/message-id/3FAFE331.2040308@bigfoot.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mendola@bigfoot.com, sgnerd@yahoo.com.sg
  Subject: Re: Dynamic Query for System functions - now()
  In-Reply-To: <3FAFE331.2040308@bigfoot.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox