Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8LZN-00BxIG-HK for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:01:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s8LZN-007ATj-DO for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:01:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8LZN-007ATa-2u for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:01:57 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8LZK-000peM-MY for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:01:55 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 3A10C2A43CF for ; Sat, 18 May 2024 08:01:53 -0700 (PDT) Date: Sat, 18 May 2024 08:01:53 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Left join syntax error In-Reply-To: Message-ID: <23486d5-be1e-f152-2b97-e027ef89a810@appl-ecosys.com> References: <2c877258-61cc-dd2d-fac7-4f2a5c6293e7@appl-ecosys.com> <9d899286-3a73-4894-a6e0-eab529c92e65@gmx.net> <3216489-758a-faef-b21b-84c9679f53c@appl-ecosys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 18 May 2024, Ray O'Donnell wrote: > You need to include the alias for the table also - see "...from companies as > c..." in Shammat's example. Ray, That didn't work: bustrac-# FROM people as p, companies as c bustrac-# LEFT JOIN companies as c ON c.company_nbr = p.company_nbr; ERROR: table name "c" specified more than once so I tried only the alias on the join line: bustrac-# LEFT JOIN c ON c.company_nbr = p.company_nbr; ERROR: relation "c" does not exist LINE 3: LEFT JOIN c ON c.company_nbr = p.company_nbr; ^ and that didn't work either. Thanks, Rich