Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 To get Non matching row after compari... vinu78 DB2 7 Fri Jan 05, 2018 5:43 pm
No new posts Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts DB2 catalog tables Pavan kumar chauhan DB2 8 Thu Dec 21, 2017 6:32 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us