Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show name instead of ID 1

Status
Not open for further replies.

l3reacher

Technical User
Jun 28, 2003
83
0
0
US
Hello I have a table called 'staff' and another name 'course'

Under 'staff' table is:

StaffID
FirstName
Lastname


Under 'Course' is:

CourseID
StaffID
CourseName

My questions is when I do a query under SQL, how do I show the staff's FirstName and Lastname instead of showing the StaffID.

I Hate Spammers and Flammers!!!
 
Simply join the tables:
SELECT C.CourseID, C.CourseName, C.StaffID, S.FirstName, S.LastName
FROM tblCourse C INNER JOIN tblStaff S ON C.StaffID = S.StaffID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, it works.

I Hate Spammers and Flammers!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top