Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zgd-0002XI-1f for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:25:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2zgc-0005lG-02 for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:25:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zgb-0005l7-NB for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:25:41 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zgZ-0004PE-EV for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:25:41 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 524532A0106 for ; Mon, 12 Jul 2021 10:25:36 -0700 (PDT) Date: Mon, 12 Jul 2021 10:25:36 -0700 (PDT) From: Rich Shepard Reply-To: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Use of '&' as table prefix in query Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Long ago I wrote a query which was greatly improved (i.e., it actually worked as intended) by help here): /* This query selects all activity information for a named person */ SELECT p.lname, p.fname, p.loc_nbr, p.job_title, p.direct_phone, p.active, o.org_name, l.loc_nbr, l.loc_name, a.act_date, a.act_type, a.notes, a.next_contact FROM People AS p JOIN Organizations AS o ON o.org_nbr = p.org_nbr JOIN Locations AS l ON l.org_nbr = o.org_nbr and l.loc_nbr = p.loc_nbr JOIN Activities AS a ON a.person_nbr = p.person_nbr WHERE p.lname = &p.lname AND p.fname = &p.fname; I did not save the reason why the ampersand is used in the WHERE row selection phrase and want now to learn why it's there. Probably needed to concatenate separate names? TIA, Rich