Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Joining 5 tables to extract the required fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Feb 13, 2007 10:38 am    Post subject: Joining 5 tables to extract the required fields
Reply with quote

I HAVE 5 TABLES AND PKS AND FIELDS WHICH ARE REQUIRED FROM THOSE AS FOLLOWS :

TABLE - A
PKS - QUOTN_REF AND CUST_PARTY_ID
FIELDS - COVR_TYPE AND COVR_STT_DT

TABLE - B
PKS - QUOTN_REF ,PRODUCT_ID,CUST_PARTY_ID,REQ_FEATURE_TYPE
FIELDS - FEATURE_RESP_VAL

TABLE - C
PKS - QUOTN_REF,PRODUCT_ID,CUST_PARTY_ID
FIELDS - PURCH_DATE


TABLE - D
PKS - QUOTN_REF, CUST_PARTY_ID, REQ_FEATURE_TYPE
FIELDS - FEATURE_REQ_VAL


TABLE - E
PKS - ASSET_ID
FIELDS - VEH_MAKE,VEH_MODEL,REGTN_NUM

"we can join on table asset_id with table TZUQTRQ_QUOT_REQ
which has a field asset_id"

NOW I NEED THE MENTIONED FIELDS FROM ALL THSE TABLES ... HOW SHUD I JOIN THESE 5 TABLES .... AND THE MAIN THING IS JOINING THE LAST TABLE - E

TIA

Warning: Caps On
Back to top
View user's profile Send private message

ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Feb 13, 2007 10:44 am    Post subject:
Reply with quote

TZUQTRQ_QUOT_REQ TABLE IS TABLE - A ...


THANKS
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Tue Feb 13, 2007 11:12 am    Post subject: Re: HELP REQUIRED ON JOINS
Reply with quote

I am not sure I understand what are trying to do, and assume that PKS is primary key? and Fields=columns you want to in result set?

Anyway, why is something like the following not possible?

Select ....
from A, B, C, D, E
where
(put your business logic)

Not sure what kind of joins you are looking for.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Feb 13, 2007 8:52 pm    Post subject: Re: HELP REQUIRED ON JOINS
Reply with quote

TIA,

Post what you have so far, I'll critique it for you. You'll learn much more if we work through this together. icon_smile.gif
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Feb 14, 2007 2:24 pm    Post subject:
Reply with quote

FIRST tell us what kind of join you want..?
INNER JOIN ..?
LEFT OUTER JOIN...?
RIGHT OUTER JOIN ..?
FULL OUTER JOIN ....?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts ISPF Tables Creation newsysprg TSO/ISPF 6 Wed Jul 13, 2016 2:21 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us