Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A3B782E2E03 for ; Thu, 10 Jan 2008 18:31:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 30119-05 for ; Thu, 10 Jan 2008 18:31:04 -0400 (AST) Received: from smtpauth.rollernet.us (smtpauth.rollernet.us [208.11.75.5]) by postgresql.org (Postfix) with ESMTP id 4309B2E2D69 for ; Thu, 10 Jan 2008 18:31:04 -0400 (AST) Received: from smtpauth.rollernet.us (localhost.localdomain [127.0.0.1]) by smtpauth.rollernet.us (Postfix) with ESMTP id 91F0B59400A; Thu, 10 Jan 2008 14:31:01 -0800 (PST) Received: from iron.denterprises.org (ool-4350518c.dyn.optonline.net [67.80.81.140]) by smtpauth.rollernet.us (Postfix) with ESMTP; Thu, 10 Jan 2008 14:31:01 -0800 (PST) Received: from [127.0.0.1] (kell.iron.denterprises.org [192.168.171.80]) by iron.denterprises.org (Postfix) with ESMTP id 7B6251675C3; Thu, 10 Jan 2008 17:31:00 -0500 (EST) Message-ID: <47869C8C.4080109@denterprises.org> Date: Thu, 10 Jan 2008 17:30:36 -0500 From: Colin Wetherbee User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Phillip Smith CC: pgsql-sql@postgresql.org Subject: Re: JOIN a table twice for different values in the same query References: <002f01c853d7$63bc0680$9b0014ac@wbaus090> In-Reply-To: <002f01c853d7$63bc0680$9b0014ac@wbaus090> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080109-0, 01/09/2008), Outbound message X-Antivirus-Status: Clean X-Rollernet-Abuse: Processed by Roller Network Mail Services. Contact abuse@rollernet.us to report violations. Abuse policy: http://rollernet.us/abuse.php X-Rollernet-Submit: Submit ID 3579.47869ca5.75539.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/82 X-Sequence-Number: 29935 Phillip Smith wrote: > As a side note - all the IATA codes are unique for each airport - > wouldn't it be better to use these as the Primary Key and Foreign > Keys? Then you wouldn't have to even join the tables unless you > wanted the port names (not just the code) This is true, but FWIW, my application will mostly be joining for the name of the airport or the city, not the code. I'll keep the idea of using the codes as keys in mind, though. Thanks for pointing that out. Colin