Re: Query to find list of dates between two dates

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query to find list of dates between two dates
Date: 2010-02-05 12:06:48
Message-ID: 20100205130648.2c4ece72@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 5 Feb 2010 02:06:12 -0800 (PST)
aravind chandu <avin_friends(at)yahoo(dot)com> wrote:

> Hello guys,
>
> can you please help me with the following query
>
> I need a query that displays all the dates in between two dates
> say i give two dates 12/1/2009 and 12/31/2009 The result should be
> like this

select
date '2008-05-01' + i
from generate_series(0,
(date '2009-12-10' - date '2008-05-01')) s(i);

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

In response to

Browse pgsql-general by date

  From Date Subject
Next Message manugarciac 2010-02-05 12:57:36 Idle in Transaction
Previous Message Andre Lopes 2010-02-05 12:01:54 Re: Query to find list of dates between two dates