X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8BA749FA5FC for ; Mon, 26 Jun 2006 20:16:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 46001-01 for ; Mon, 26 Jun 2006 20:16:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx2.surnet.cl (mx2.surnet.cl [216.155.73.181]) by postgresql.org (Postfix) with ESMTP id 22CD59FA2F7 for ; Mon, 26 Jun 2006 20:16:30 -0300 (ADT) Received: from unknown (HELO alvh.no-ip.org) ([201.221.201.100]) by mx2.surnet.cl with ESMTP; 26 Jun 2006 19:16:29 -0400 X-IronPort-AV: i="4.06,178,1149480000"; d="scan'208"; a="61868021:sNHT19496616" Received: by alvh.no-ip.org (Postfix, from userid 1000) id 29840C22E96; Mon, 26 Jun 2006 19:16:28 -0400 (CLT) Date: Mon, 26 Jun 2006 19:16:28 -0400 From: Alvaro Herrera To: operationsengineer1@yahoo.com Cc: pgsql-sql@postgresql.org Subject: Re: Problem w/ Join... Using (...) Syntax Message-ID: <20060626231627.GG11926@surnet.cl> Mail-Followup-To: operationsengineer1@yahoo.com, pgsql-sql@postgresql.org References: <20060626230355.79032.qmail@web33301.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060626230355.79032.qmail@web33301.mail.mud.yahoo.com> User-Agent: Mutt/1.5.11+cvs20060403 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/274 X-Sequence-Number: 25510 operationsengineer1@yahoo.com wrote: > how does one apply the JOIN... USING (...) syntax when > the primary key and foreign key have different names? > > JOIN t_employee USING (employee_id) > > works perfect when the primary and foreign key are > both named employee_id. t_inspection JOIN t_employee ON (t_employee.employee_id = t_inspection.inspector_id) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.