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 1s8MAQ-00C0rW-6A for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:40:15 +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 1s8MAQ-00862D-7Y for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2024 15:40:14 +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 1s8MAP-008625-TP for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:40:13 +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 1s8MAM-000tfS-Mq for pgsql-general@lists.postgresql.org; Sat, 18 May 2024 15:40:13 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 921A82A43CF for ; Sat, 18 May 2024 08:40:09 -0700 (PDT) Date: Sat, 18 May 2024 08:40:09 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Left join syntax error In-Reply-To: <7c4b1acc-951b-473f-bdc3-c4ae7298f875@rodonnell.ie> Message-ID: <35e0eedd-94c-882c-c6f2-68f2b5b6331c@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> <23486d5-be1e-f152-2b97-e027ef89a810@appl-ecosys.com> <7c4b1acc-951b-473f-bdc3-c4ae7298f875@rodonnell.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT 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: > Look again at Shammat's example! - > > 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 > > NB - "... from people as p left join companies as c on ...." - i.e. the > companies table (or its alias c) is only specified once. Ray, Yes, I did mis-read that. Many thanks, Rich