petebristol
Programmer
Hello,
Please can you help?
I've tied myself up in knots recently trying to understand joins (specifically to more than 2 tables) and I think I need some clarification before I can go any further.
I've read in so many places over the web that a "join is a relationship between two and only two tables". Is this correct?
In this example, for instance, it's clear that the "relationship" is between Table1 & Table2.
Select * from Table1 inner join Table2 on .....
But what about this?
Select * from Table1 inner join Table2 on..... inner join Table3 on ......
Does the bolded text effectively become one "table" so the relationship forms between this and Table3?
Given all of that, does the ordering of the joins in the SQL statement make a difference? Or does the Query Optimiser some-how sort it all out to generate the same answer?
I really appreciate any help given and look forward to any replies with anticipation.
Regards,
Pete
Please can you help?
I've tied myself up in knots recently trying to understand joins (specifically to more than 2 tables) and I think I need some clarification before I can go any further.
I've read in so many places over the web that a "join is a relationship between two and only two tables". Is this correct?
In this example, for instance, it's clear that the "relationship" is between Table1 & Table2.
Select * from Table1 inner join Table2 on .....
But what about this?
Select * from Table1 inner join Table2 on..... inner join Table3 on ......
Does the bolded text effectively become one "table" so the relationship forms between this and Table3?
Given all of that, does the ordering of the joins in the SQL statement make a difference? Or does the Query Optimiser some-how sort it all out to generate the same answer?
I really appreciate any help given and look forward to any replies with anticipation.
Regards,
Pete