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!

multi table query joins

Status
Not open for further replies.

SQLnewcommer

Technical User
Oct 7, 2005
15
0
0
US
Hello,

I have reading about queries involving more than two tables. But I am still confused.

Suppose I have 5 tables A,B,C, D and Q

I have already joined A,B,C,D. Q can be joined to A, B or C ( has their foreign keys) . How do I decide whether to join Q to A,B or C?

Similarly, will the way in which tables are joined affect the result?

I have joined A->B, A->C, A->D and A->Q
I can also join as C->B, C->A B->D Q->A

The keys permit the following orders. How do I know which way to join? What are the things I need to take into consideration while writing the join criteria???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top