Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0310E2E0054 for ; Sun, 27 Jan 2008 20:48:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 57735-05 for ; Sun, 27 Jan 2008 20:48:40 -0400 (AST) Received: from outJ.internet-mail-service.net (outJ.internet-mail-service.net [216.240.47.233]) by postgresql.org (Postfix) with ESMTP id DFC1F2E0052 for ; Sun, 27 Jan 2008 20:48:50 -0400 (AST) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sun, 27 Jan 2008 16:48:48 -0800 X-Client-Authorized: MaGic Cook1e Received: from [192.168.1.109] (adsl-71-135-191-42.dsl.pltn13.pacbell.net [71.135.191.42]) by idiom.com (Postfix) with ESMTP id 1EF10127024 for ; Sun, 27 Jan 2008 16:48:48 -0800 (PST) Message-ID: <479D2694.3090202@obviously.com> Date: Sun, 27 Jan 2008 16:49:24 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20070803 SUSE/1.1.7-0.1 SeaMonkey/1.1.7 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Syntax question: use of join/using with fully qualified table name Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL=0.196, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200801/206 X-Sequence-Number: 30059 I've got a join where a certain column name appears twice: select username,last_name from eg_member join eg_membership using (member_id) join eg_account using (account_id) join eg_person using (person_id); ERROR: common column name "person_id" appears more than once in left table My first inclination was to fully quality the table name. Why would this not be acceptable syntax? select username,last_name from eg_member join eg_membership using (member_id) join eg_account using (account_id) join eg_person using (eg_member.person_id); ERROR: syntax error at or near "." at character 145 Of course I eventually wrote it: select username,last_name from eg_member join eg_membership using (member_id) join eg_account using (account_id) join eg_person on eg_member.person_id=eg_person.person_id'; PostgreSQL 8.1.9 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51) -- ---- Visit http://www.obviously.com/