referring to calculated column in sub select - Mailing list pgsql-general

From Scara Maccai
Subject referring to calculated column in sub select
Date
Msg-id 774626.9811.qm@web24615.mail.ird.yahoo.com
Whole thread Raw
Responses Re: referring to calculated column in sub select
Re: referring to calculated column in sub select
List pgsql-general
Hi,

why column "acoltest" is not found by the subselect in this select:


SELECT
      acol + 100 as acoltest,
     (select max(t) from mytab where anothercol=acoltest) as col2
FROM mytab2
group by somet
???
Only columns belonging to a table can be used in a subselect??? What about "calculated" columns?
Thank you




pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Need help
Next
From: Tom Lane
Date:
Subject: Re: Is this a bug or a feature? Column visibility in subquery from outer query