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 1s8M95-00C0i4-Gh for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:38:52 +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 1s8M94-0082Nu-Ul for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:38:50 +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 1s8M94-0082Nm-AX for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:38:50 +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 1s8M91-000pvv-OC for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:38:48 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id C76DA2A43CF for ; Sat, 18 May 2024 08:38:46 -0700 (PDT) Date: Sat, 18 May 2024 08:38:46 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Left join syntax error In-Reply-To: <2e4c19a5-9547-40cc-93e3-75776547b26f@aklaver.com> Message-ID: References: <2c877258-61cc-dd2d-fac7-4f2a5c6293e7@appl-ecosys.com> <9d899286-3a73-4894-a6e0-eab529c92e65@gmx.net> <3216489-758a-faef-b21b-84c9679f53c@appl-ecosys.com> <23486d5-be1e-f152-2b97-e027ef89a810@appl-ecosys.com> <2e4c19a5-9547-40cc-93e3-75776547b26f@aklaver.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, Adrian Klaver wrote: > The query needs to be: > > SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name > FROM people as p > LEFT JOIN companies as c ON c.company_nbr = p.company_nbr; > > Only reference companies as c once. Thanks, Adrian. I mis-read your original post. Regards, Rich