MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to join more than two tabels in datacom

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Sat Oct 11, 2003 1:47 am    Post subject: How to join more than two tabels in datacom Reply with quote

Hi,
My problem is like this,
I have three tables x,y,z in Datacom. Frist I want to select a contract number from tabel x if its "status" is "active", For each row found I want search in table Y or Z by using contract number. and write there temination date. Confused

please help me.......

Regards,
Chandra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Oct 11, 2003 6:54 am    Post subject: Reply with quote

chandra,

Try this sql

Code:

       SELECT *
         FROM YTABLE
         WHERE CONTRACT_NO IN ( SELECT CONTRACT_NO   
                                  FROM XTABLE
                                 WHERE STATUS=ACTIVE)
        UNION
       SELECT *
         FROM ZTABLE
         WHERE CONTRACT_NO IN ( SELECT CONTRACT_NO   
                                  FROM XTABLE
                                 WHERE STATUS=ACTIVE)


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Sun Oct 12, 2003 11:44 pm    Post subject: Reply with quote

Hi Kolusu,
This is SQl query,This will not work in DATACOM.
I need datacom query..

Sad
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group