Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2475F633A52 for ; Fri, 21 Aug 2009 00:18:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 31373-02 for ; Fri, 21 Aug 2009 03:17:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 42365632896 for ; Fri, 21 Aug 2009 00:17:53 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MeKdT-0006jM-Nn for pgsql-sql@postgresql.org; Thu, 20 Aug 2009 20:17:51 -0700 Message-ID: <25073534.post@talk.nabble.com> Date: Thu, 20 Aug 2009 20:17:51 -0700 (PDT) From: tripplowe To: pgsql-sql@postgresql.org Subject: Rewrite multiple joins... MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tripplowe@gmail.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/119 X-Sequence-Number: 33028 Hey Folks, I have a query that seems like it will never end. I'm hoping you can help me rewrite it. I have 4 tables that contain information about house sales within the state (sale, taxes, property, buyer). Each table has an 'id' field that links each record. I am just trying to flatten these files so I will have all of the information in a single file. Below is my attempt to do so. Is there a more efficient way to rewrite the joins? select * from sale, taxes, property, buyer where sale.id = taxes.id and sale.id = property.id and sale.id = buyer.id I'm using postgresql 8.3 on a Windows 7 machine. Thank You, -Tripp -- View this message in context: http://www.nabble.com/Rewrite-multiple-joins...-tp25073534p25073534.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.