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 |
|
josethegeek
Starting Member
45 Posts |
Posted - 2005-01-04 : 14:02:52
|
| Okay, this is something that I've come across multiple times, and instead of using the newer JOINS syntax I've stuck to the older syntax. I finally want to figure out how to join 3 tables using Joins.Here is a scenario.I have a group that has people and those people can have friends.Here are the tables.tbl_GroupsGroup_IDGroup_Nametbl_PeoplePeople_IDGroup_IDPeople_FirstNamePeople_LastNametbl_FriendsPeople_IDFriend_IDI would like to do an INNER JOIN on Group and People, and do a LEFT JOIN on people and friendsI was able to do this with the older join syntaxSELECT tbl_People.People_FirstName, tbl_People.People_LastName FROM tbl_People, tbl_Groups, tbl_Friends WHERE tbl_Groups.Group_ID = tbl_People.Group_ID AND tbl_People.People_ID *= tbl_Friends.People_IDCould someone show me how to convert this to the newer syntax?Thanks,Jose |
|
|
deangc
Starting Member
3 Posts |
Posted - 2005-01-04 : 14:23:47
|
The syntax is actually clearer once you get used to it.SELECT tbl_People.People_FirstName, tbl_People.People_LastName FROM tbl_People JOIN tbl_Groups ON tbl_Groups.Group_ID = tbl_People.Group_IDLEFT OUTER JOIN tbl_FriendsON tbl_People.People_ID = tbl_Friends.People_ID |
 |
|
|
|
|
|