If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Column (d) not found in any table in the query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-11, 08:09
Helen Pippard Helen Pippard is offline
Registered User
 
Join Date: Dec 2011
Posts: 30
Column (d) not found in any table in the query

Hello,

I am new to informix and require some help to write a query with an inline view

When I write following syntex I get the following error message:
Column (d) not found in any table in the query

Is anytone able to help me fix this problem, and then where would I put another inline view?

Select a.clrec_identity,
and a.clmov_movedate =
(Select MAX(clmov_movedate) pen_date
FROM clinrec_movements d
WHERE d.clmov_movedate < a.clmov_movedate
and d.clrec_identity = 1 )

Any advice?

Thanks
Helen

Last edited by Helen Pippard; 12-09-11 at 10:02.
Reply With Quote
  #2 (permalink)  
Old 12-09-11, 08:36
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Code:
SELECT a.clrec_identity
     , a.clmov_movedate
     , a.clmov_loctype
     , a.clmov_loccode
     , a.clmov_type
     , c.pmi_link
     , ( SELECT MAX(clmov_movedate) 
           FROM clinrec_movements 
          WHERE clmov_movedate < a.clmov_movedate
            AND clrec_identity = 1 ) pen_date
  FROM clinrec_movements a
INNER
  JOIN clinrec_movenumber b
    ON b.clrec_identity = a.clrec_identity
   AND b.clmov_index    = a.clmov_index
INNER
  JOIN clinical_records c
    ON c.clrec_identity = a.clrec_identity
 WHERE a.clrec_identity = 1
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-09-11, 08:42
Helen Pippard Helen Pippard is offline
Registered User
 
Join Date: Dec 2011
Posts: 30
Hello

Thank you very much for your response. I really appreciate it

I have tried the code I and I am getting a syntex error, and cannot see why

Also whilst you are still there, If I were to add another sub query would I put a comma in the following place:

SELECT a.clrec_identity
, , ( SELECT MAX(clmov_movedate)
FROM clinrec_movements
WHERE clmov_movedate < a.clmov_movedate
AND clrec_identity = 100027 ) pen_date
, ( SELECT.........................................) MAXOf

Thanks in advance for any further advice

Last edited by Helen Pippard; 12-09-11 at 10:02.
Reply With Quote
  #4 (permalink)  
Old 12-09-11, 08:57
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by Helen Pippard View Post
I have tried the code I and I am getting a syntex error, and cannot see why
neither can i

my version of Microsoft® CrystalBall© is down at the moment

Quote:
Originally Posted by Helen Pippard View Post
Also whilst you are still there, If I were to add another sub query would I put a comma in the following place:
yes
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 12-09-11, 09:00
Helen Pippard Helen Pippard is offline
Registered User
 
Join Date: Dec 2011
Posts: 30
Thanks for your help!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On