Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3E20D9FB33B for ; Mon, 12 Mar 2007 16:10:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 86443-01 for ; Mon, 12 Mar 2007 16:10:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id F1AE89FB40D for ; Mon, 12 Mar 2007 16:10:30 -0300 (ADT) Received: from a-kretschmer.de (p54B3946E.dip0.t-ipconnect.de [84.179.148.110]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id l2CJAPsA028001 for ; Mon, 12 Mar 2007 20:10:25 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.61) (envelope-from ) id 1HQpvT-0001Lc-Ut for pgsql-sql@postgresql.org; Mon, 12 Mar 2007 20:11:19 +0100 Date: Mon, 12 Mar 2007 20:11:19 +0100 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: how to use a date range in a join Message-ID: <20070312191119.GA4578@KanotixBox> References: <208535.83136.qm@web54314.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <208535.83136.qm@web54314.mail.yahoo.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.442 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/144 X-Sequence-Number: 27782 chester c young schrieb: > trying to do something like > > select d.day, > c.name > from [dates between day1 and day2] d > left join c.some_table; > > but cannot figure out what to put into the brackets. Perhaps something like this: test=# select current_date + (generate_series(1,10)||'day')::interval; ?column? --------------------- 2007-03-13 00:00:00 2007-03-14 00:00:00 2007-03-15 00:00:00 2007-03-16 00:00:00 2007-03-17 00:00:00 2007-03-18 00:00:00 2007-03-19 00:00:00 2007-03-20 00:00:00 2007-03-21 00:00:00 2007-03-22 00:00:00 (10 rows) If not, sorry, then please define your problem. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°