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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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