need to add col from third table of join

Posted on 2013-08-30
Medium Priority
Last Modified: 2013-09-10
i need to add a col from the third table I need ad.IARCC9                                      

it's not displaying this col. i

select ItQty#,IhDocd,ItPRT# from pklib.Fileout1 a      
ad.IARCC9 from astdta.audia                            
b.CtCom#= a.ItCom# and                                  
b.CtCtr# = ' '     and                                  
b.CtPrt# =a.ItPrt#                                      
join astdta.Audia ad                                    
on ad.IAprt# = a.ItPrt#                                
where ad.IARCC9 > ''                                    
order by ad.IARCC9
Question by:Philky101
LVL 71

Accepted Solution

Éric Moreau earned 2000 total points
ID: 39453518
you have 2 FROM clause and you don't have the definition for alias B

Author Comment

ID: 39453601
can you explain me\ this further. This is getting me output needed. But need the third\ table col on the output.
LVL 71

Expert Comment

by:Éric Moreau
ID: 39453757
Can You show your working query with 2 tables and the structure of the 3rd table?
LVL 13

Expert Comment

ID: 39454430
The query is unclear, but try this
select ItQty#,IhDocd,ItPRT#, b.IARCC9 from pklib.Fileout1 a
astdta.audia b, third_table c 
 where c.CtCom#= a.ItCom#
and c.CtCtr# = ' '
and c.CtPrt# =a.ItPrt#
and b.IAprt# = a.ItPrt#                                
and b.IARCC9 > ''
order by b.IARCC9 

Open in new window

LVL 75

Expert Comment

by:Anthony Perkins
ID: 39456656

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question