Use of '&' as table prefix in query

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Use of '&' as table prefix in query
Дата
Msg-id alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com
обсуждение исходный текст
Ответы Re: Use of '&' as table prefix in query  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Use of '&' as table prefix in query  (Rob Sargent <robjsargent@gmail.com>)
Re: Use of '&' as table prefix in query [RESOLVED]  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Undocumented array_val[generate_series(...)] functionality?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Use of '&' as table prefix in query