Re: JOIN a table twice for different values in the same query

From: Colin Wetherbee <cww(at)denterprises(dot)org>
To: Phillip Smith <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: JOIN a table twice for different values in the same query
Date: 2008-01-10 22:30:36
Message-ID: 47869C8C.4080109@denterprises.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Colin Wetherbee 2008-01-10 22:40:55 Re: JOIN a table twice for different values in the same query
Previous Message Phillip Smith 2008-01-10 22:23:12 Re: JOIN a table twice for different values in the same query