Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sqlclarify
Yak Posting Veteran
56 Posts |
Posted - 2008-11-06 : 22:49:26
|
| I am having trouble finding out how to join tables. I mean I need help understanding how to find the join criteria between several tables. If I have 5 tablesselect * from tableA, tableB, tableC, tableD,tableEwherejoin1join2join3join4How do we figure out the joins? Is it always going to be the relationships between the tables? So if we write another query using the same tables are the join criterias going to be the same. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-06 : 23:46:08
|
first of all what you've given is old way of joins. Laern to use ANSI join syntax as other join syntax wont be supported in future versions of sql server.Rewriting you code, it will be like belowselect * from tableA{inner/left/right/full} join tableBon joincondition1{inner/left/right/full} tableCon joincondition2{inner/left/right/full} tableDon joincondition3{inner/left/right/full} tableEon joincondition4the join condition is determined by what columns the two tables are related. |
 |
|
|
|
|
|