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!

Ambiguous Joins

Status
Not open for further replies.

DeanWilliams

Programmer
Feb 26, 2003
236
GB
Hi,
I am creating a database for a mobile phone company that covers insurance claims. They repair and send out mobile phones. My dilemma is this: I have to track individual phones and a customer with a policy can have entries of more than one phone sent (to them) and returned (to us) against this claim. This can be a different or the same phone, once repaired. With me? A diagram might make it easier to understand.

Basically I have come up with this in my relationships view and would like to know if it is safe to structure it this way:

RelationshipView.jpg


A Claim can have 0 or more Sent & Return records, and these in turn relate to the Stock table which is where the actual phone details are stored.
This 'diamond' shape relationship has already given me problems with queries and ambiguous joins, but I can just get over this with subqueries, right?

Is it OK to have relationships like this or should I be doing it a different way? Can anyone foresee any problems down the line?

Thanks,
Dean.
 
If you use left or right joins, you must do so throughout the whole query. It is like a flow: the selection just follows the arrows. So if you have a query that looks like this:

table1 --> table2 --- table3

You'll have to change it to:

table1 --> table2 --> table3

in the query view.

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top