Re: seleting all dates between two dates

From: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: seleting all dates between two dates
Date: 2001-06-04 21:39:26
Message-ID: 3B1C000E.6535B419@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jeff Barrett schrieb:

> I am interested in a query where I can select all dates between two dates. I
> figure I can build a table of all valid dates with a resonable range and
> then select from that table, but I would like to use the power of sql to get
> the work done without building a date table. Any ideas?
>
> For example:
> I want all dates between 05-29-2001 and 06-02-2001
> The result set would be:
> 05-30-2001
> 05-31-2001
> 06-01-2001
>
> Thanks for the help.
> -Jeff

In my opinion there is no reasonable way to solve your problem by using SQL
only
Why don't you use a temporary table created by a simple PL/pgSQL function?

Hans

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-06-04 21:45:10 Re: select distinct too slow
Previous Message Josh Berkus 2001-06-04 21:32:49 Re: SQL Date Challenge