Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alias/Join problem

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
0
0
GB
I have a problem involving 3 tables in a Universe that i am currently working on, the platform is DB2.

Basically my three tables a b and c are connected as follows, one of three fields in table a will be connected to a single field in table b... And a single field in table b will be connected to a single field in table c.

At the moment i have a single table for a and three tables for each of b and c (the original and two aliases) to represent each of the possible joins to table a.

I was hoping to have a single table C joining into all three table b's - is this possible and how should i approach it??

Also is it worthwhile trying to eliminate all of my aliases in these three tables?? As i would like to create a report that contains information on all three aliases of b and c...

 
First please mention what is the logic based of which you decide which of the 3 fields should be used to join to table b. And is only one of the three b tables is used in any sql generated in that case you can eliminate the aliases else you have to stay with ur current design
Assuming this is not the case then
In case is logic is null then you can use a decode or case statement (which ever is applicable in DB2) to write a customized join clause between table a and b.
Since the join between b and c is the same where you are joining c-alias 1 and b- alias 1 so you can use a single table joined to table b.
 
It really depends on what's in those tables. Which ones are your facts and which are your dimensions?

Steve Krandel
Knightsbridge Solutions
formerly BASE Consulting Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top