Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5BClGE56362 for ; Mon, 11 Jun 2001 08:47:16 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f54LwWE44762 for ; Mon, 4 Jun 2001 17:58:32 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f54Lf7k73906 for pgsql-sql@postgresql.org; Mon, 4 Jun 2001 17:41:07 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.sql Subject: Re: seleting all dates between two dates Date: Mon, 04 Jun 2001 23:39:26 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 23 Message-ID: <3B1C000E.6535B419@cybertec.at> References: <9f8pg1$kem$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200106/153 X-Sequence-Number: 3374 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