pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tripplowe <tripplowe@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Rewrite multiple joins...
Date: Thu, 20 Aug 2009 20:17:51 -0700 (PDT)
Message-ID: <25073534.post@talk.nabble.com> (raw)


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.




view thread (2+ messages)  latest in thread

Message-ID: <25073534.post@talk.nabble.com>
Permalink:  ../25073534.post@talk.nabble.com/
Also on:    postgresql.org/message-id/25073534.post@talk.nabble.com

 · 

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: tripplowe@gmail.com
  Subject: Re: Rewrite multiple joins...
  In-Reply-To: <25073534.post@talk.nabble.com>

* 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