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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Join multiple tables

Author  Topic 

mvniel
Starting Member

2 Posts

Posted - 2003-01-15 : 08:14:42
How can use the 'join' function on more than two tables and what is the correct syntax? Hope anybody can help me. Thnx.

rihardh
Constraint Violating Yak Guru

307 Posts

Posted - 2003-01-15 : 08:22:54
Look it up in Books On Line...

Go to Top of Page

Robwhittaker
Yak Posting Veteran

85 Posts

Posted - 2003-01-15 : 08:47:16
same as if you're joining to 1 table just repeated

ie
select blah
from table t
left join table2 t2
on t.key = t2.fk
left join table3 t3
on t.key2 = t3.fk
where a=b

(or whatever kind of join you want)


Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-01-15 : 08:58:17
Be careful. A join is not a function.
quote:
"As a verb, to combine the contents of two or more tables and produce a result set that incorporates rows and columns from each table. Tables are typically joined using data that they have in common. As a noun, the process or result of joining tables, as in the term "inner join" to indicate a particular method of joining tables."
-Books Online


I typically don't like the "RTFM" type responses here, but honestly, it is right there in BOL. There's a page called "Joining Three or More Tables" in the "Using Joins" chapter.

Jay White
{0}
Go to Top of Page

mvniel
Starting Member

2 Posts

Posted - 2003-01-15 : 09:05:52
Thanx for the quick response, i'm a novice at this. Tried already to look it up on the net, but apparently not good enough :-)

Seems to work fine now...

Go to Top of Page

Robwhittaker
Yak Posting Veteran

85 Posts

Posted - 2003-01-15 : 09:09:14
The help that comes with SQLServer or Books on line (BOL) as it's properly known is very good, check it out before the net.

Go to Top of Page
   

- Advertisement -