X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2AB559FB1B9 for ; Tue, 6 Jun 2006 15:27:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 39623-06 for ; Tue, 6 Jun 2006 15:27:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 1ADD59FA13E for ; Tue, 6 Jun 2006 15:27:47 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1FngLE-0006C7-33 for pgsql-sql@postgresql.org; Tue, 06 Jun 2006 14:31:48 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 9BCA7417B; Tue, 6 Jun 2006 14:27:36 -0400 (EDT) Date: Tue, 6 Jun 2006 14:27:36 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Join issue Message-ID: <20060606182736.GI10018@phlogiston.dyndns.org> References: <1b8a973c0606061110r5deece44q485eeffc6108485d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1b8a973c0606061110r5deece44q485eeffc6108485d@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/71 X-Sequence-Number: 25307 On Tue, Jun 06, 2006 at 11:10:46AM -0700, Burak Seydioglu wrote: > I have a query to return the latest contract and contract status for a > house... What i am trying to do is to get the rate of electricity for the > latest contract... I am trying to retrieve the latest provider rate before a > contract is signed. I don't have a proposal to rewrite, but I suspec this is going to be easier with a query to get the latest provider rate in the FROM clause. A -- Andrew Sullivan | ajs@crankycanuck.ca Users never remark, "Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath." --Damien Katz