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 |
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2003-02-21 : 22:23:13
|
| I have 3 tables and the only thing they shar is each has a coulmn named player id. How do I pull all the info from all 3 tables at one time? I know how to use an inner join on 2 tables but not 3.--For those with wings, fly to your dreamsDearms are what are found at the end of reality, and your reality if what is found at the end of your dreams. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-02-21 : 23:35:43
|
| SELECT * FROM Table1 AINNER JOIN Table2 B ON A.PlayerID=B.PlayerIDINNER JOIN Table3 C ON A.PlayerID=C.PlayerIDYou have the option of joining B and C together, instead of A and C, since these are inner joins they would be equivalent. I would suggest that if the column(s) being joined are primary key in a table, that table should be used in the join conditions as much as possible, as it will be more likely to utilize the index. |
 |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2003-02-22 : 15:08:19
|
| Would doing an innner joins let me update coulmns in all 3 tables?--For those with wings, fly to your dreamsDearms are what are found at the end of reality, and your reality if what is found at the end of your dreams. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-02-22 : 16:04:44
|
| No. UPDATEs can only modify one table at a time, whether you join them or not. |
 |
|
|
|
|
|