From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Use of '&' as table prefix in query
Date: Mon, 12 Jul 2021 10:25:36 -0700 (PDT)
Message-ID: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rshepard@appl-ecosys.com
Subject: Re: Use of '&' as table prefix in query
In-Reply-To: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox