Unix Technical Forum

Problem with inner queries

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, ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 10:27 AM
Andrea
 
Posts: n/a
Default Problem with inner queries

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com