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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One of three fields connect to another table

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi,

I have two tables taht are linked ny one of three fields in the first table to one field in the second table. I have set the relationship up with three different outer links between the two tables (with each of the three possibilities in the firat table linking to the single field in the secound table)

Do you think that this is the right way to go about this solution or is a sinlge multiple join the answer (Not come across it in BO before but was thinking something along the lines of an or statement, eg: fieldA = FieldB or FieldC or FieldD)

Any comments or suggestions will be grately appreciated

Dr Smyth


[afro]
 
Do you always have data in each of the 3 fields in the first table? Or do you only have data in 1 of the 3 fields?

If this later is the case, could you use CASE or DECODE or NVL (in Oracle, or the equivalents in other DBs) to reduce the potential 3 fields down to one definitive field? If so you could then join this to Table 2
 
Can have data in 1 or 2 out of the 3 fields, how would this work...

If i'm using case or decode (I'm using a db2 database), would this be entered into the join expression? What would the syntax be for this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top