This is a discussion on Problem with inner queries within the Informix forums, part of the Database Server Software category; --> I'm doing the following query SELECT codazorig, ( SELECT cinnodo FROM nodi WHERE nodi.codaznodo = codazorig) AS cinnodoorig, codazdest, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm doing the following query SELECT codazorig, ( SELECT cinnodo FROM nodi WHERE nodi.codaznodo = codazorig) AS cinnodoorig, codazdest, ( SELECT cinnodo FROM nodi WHERE nodi.codaznodo = codazdest) AS cinnododest FROM traduzionearchi that is used to convert a field to another one (codazorig to cinnodoorig and codazdest to cinnododest). Then I want to use the obtained fiels to filter the data in another table. I tried the following code but got an error message telling me that the columns cinnododest and cinnodoorig could not be found. Here's the failing code: SELECT codazorig, na, nb, archi.cinarco, ( SELECT cinnodo FROM nodi WHERE nodi.codaznodo = codazorig) AS cinnodoorig, codazdest, ( SELECT cinnodo FROM nodi WHERE nodi.codaznodo = codazdest) AS cinnododest FROM traduzionearchi,archi WHERE (archi.cinnodoor=cinnodoorig AND archi.cinnododes=cinnododest); How can I fix this? Thanks a lot Andrea |