IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Joining 5 tables to extract the required fields


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts optim extract file - SAS DB2 2
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
Search our Forums:

Back to Top