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 1s8LKf-00BvZB-Kc for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 14:46:47 +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 1s8LKe-006e2m-O2 for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 14:46:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8LKe-006e2e-DK for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 14:46:44 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8LKa-000tDT-Ej for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 14:46:43 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 659BC2A43CF for ; Sat, 18 May 2024 07:46:39 -0700 (PDT) Date: Sat, 18 May 2024 07:46:39 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Left join syntax error In-Reply-To: <9d899286-3a73-4894-a6e0-eab529c92e65@gmx.net> Message-ID: <3216489-758a-faef-b21b-84c9679f53c@appl-ecosys.com> References: <2c877258-61cc-dd2d-fac7-4f2a5c6293e7@appl-ecosys.com> <9d899286-3a73-4894-a6e0-eab529c92e65@gmx.net> 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, Shammat wrote: > Don't put the second table in the FROM part > > 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 Shammat, I tried this with this result: ERROR: missing FROM-clause entry for table "c" LINE 3: LEFT JOIN companies ON c.company_nbr = p.company_nbr; Thanks for the suggestion. Regards, Rich