public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Sam Stearns <[email protected]>
Cc: [email protected]
Cc: Peter Garza <[email protected]>
Cc: Henry Ashu <[email protected]>
Subject: Re: invalid reference to FROM-clause entry for table
Date: Thu, 03 Oct 2024 18:21:32 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAN6TVj=Kn0b1a5NDujb8rgWG8jDJhGLMWwCW-ZgQEuM=vND=dA@mail.gmail.com>
References: <CAN6TVj=Kn0b1a5NDujb8rgWG8jDJhGLMWwCW-ZgQEuM=vND=dA@mail.gmail.com>
Sam Stearns <[email protected]> writes:
> This one is really doing my head in:
> ...
> FROM (pud_fme_data d
> inner join csbuser u on (u.userid=d.user_id)
> inner join office o on (u.officeid=o.officeid)
> left outer join login l on (l.userid=u.userid) ) alias6;
> ERROR: invalid reference to FROM-clause entry for table "o"
> LINE 2: o.crmaccountid AS crm_account_id,
> ^
> DETAIL: There is an entry for table "o", but it cannot be referenced from
> this part of the query.
IIRC, the join alias "alias6" hides any table aliases inside it.
Leave that off. Or reference the column as "alias6.crmaccountid".
(This way might require fooling around with column aliases so that
crmaccountid is a unique column name within that scope.)
regards, tom lane
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: invalid reference to FROM-clause entry for table
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox