Search Postgresql Archives

Re: Query to find list of dates between two dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Feb 2010 02:06:12 -0800 (PST)
aravind chandu <avin_friends@xxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux