pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hans-Jürgen Schönig <hs@cybertec.at>
To: pgsql-sql@postgresql.org
Subject: Re: seleting all dates between two dates
Date: Mon, 04 Jun 2001 23:39:26 +0200
Message-ID: <3B1C000E.6535B419@cybertec.at> (raw)
References: <9f8pg1$kem$1@news.tht.net>

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




view thread (4+ messages)  latest in thread

Message-ID: <3B1C000E.6535B419@cybertec.at>
Permalink:  ../3B1C000E.6535B419@cybertec.at/
Also on:    postgresql.org/message-id/3B1C000E.6535B419@cybertec.at

 · 

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: hs@cybertec.at
  Subject: Re: seleting all dates between two dates
  In-Reply-To: <3B1C000E.6535B419@cybertec.at>

* 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