Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7UKWQf68481 for ; Thu, 30 Aug 2001 16:32:26 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f7UKVEF59618 for pgsql-sql@postgresql.org; Thu, 30 Aug 2001 16:31:14 -0400 (EDT) (envelope-from news) From: Marc =?iso-8859-1?Q?Andr=E9?= Paquin X-Newsgroups: comp.databases.postgresql.sql Subject: 2 tables, joins and same name... Date: Thu, 30 Aug 2001 16:25:41 -0400 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 38 Message-ID: <3B8EA145.1E9349F3@inter-resa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.51 [en] (Win98; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200108/377 X-Sequence-Number: 4636 Hello, Here is 2 tables: airport --------- airport_id name code city_id destination ----------- destination_id dest_name ... airport_dep_id // using airport.airport_id (departure) airport_arr_id // using airport.airport_id has well (arrival) I have 2 columns in the second table that uses the same name column in the first table... I dont know how to formulate my SQL query... I want to select the destinations in the destination table with not the ID of each airport but their names. I can do a join with one but with the second one, I get no results... And this is confusing! select dest.dest_name, air.name as airport1, air.name as airport2 from destination, airport air where dest.airport_dep_id_id=air.airport_id and dest.airport_arr_id=air.airport_id; This is not good... Any help? Thanks! -- Marc Andre Paquin