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)
 Multiple Joins to retrieve names

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-08 : 18:57:40
Lane writes "Hi,
I have a DB where the identifying key is called MCHN (like a SSN) I have a query that returns the MCHN, but how do I get it to link to my table of names to display the names for more than 1 person?

Here's the relevant info

TBLCREWMEMBERS
MCHN (B5263)
Lastname (Boyd)
Firstname (Lane)


TBL103
MCHN (Person who rec'd training)
CREW PARTNER (Partner of person who rec'd training)
OBSERVED (Observer of training--May be NULL)
(In this table, each value is represented by the individual's MCHN)

Here's what I have so far:
SELECT tblCrewMembers.LastName, TblCrewMembers.FirstName, Tbl103.MCHN, Tbl103.[Crew Partner]
FROM Tbl103 INNER JOIN TblCrewMembers ON Tbl103.observed = TblCrewMembers.MHCN

It works, but only returns the last/first name of the observer and the MCHNs of the "trainee" and "partner" How do I get it to display the names of these 2 people? I'm running SQL Server 7.0 on Windows NT 4.0 SP 6A Thanks in advance for your help.

Lane"
   

- Advertisement -