Subject Re: How select against a sub-select field?
Author rogervellacott
I think you would have to repeat the sub-query, for example

....
WHERE EXISTS (SELECT RIPARTITO FROM PIANO_CONTI SSPC WHERE
(SSPC.ESERCIZIO_ID=OPC.ESERCIZIO_ID)
AND (SSPC.AnotherField = :A_Parameter )




--- In ib-support@y..., "mmenaz" <mmenaz@l...> wrote:
> Hi, I've a query like this:
> SELECT PIANO_CONTI.ESERCIZIO_ID,
> PIANO_CONTI.CONDOMINIO_ID,
> PIANO_CONTI.CONTO_ID,
> PIANO_CONTI.DESCRIZIONEDISP,
> (SELECT RIPARTITO FROM PIANO_CONTI SSPC WHERE
(SSPC.ESERCIZIO_ID=OPC.ESERCIZIO_ID) ) RIP
> FROM PIANO_CONTI OPC
> WHERE RIP='S'
>
> I get the error "Column does not belong to referenced table." about
the 'RIP' condition in the where clause.
> Seems that I can not reference that field taht comes from a sub-
select. How can I reference it in the Where?
> Thanks
> Marco Menardi