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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining a table to itself.

Status
Not open for further replies.

countdrak

Programmer
Jun 20, 2003
358
US
I have a table with colums, ID,firstname,lastname,supervisorID
So something like this.

ID FirstName LastName SupervisorID
1 John Smith 3
2 Mike Harris 1
3 Chris Small 0


Now I wanna write a query where instead of the supervisorid I can show the firstname and lastname of the supervisor. I want to join the table to itself. So instead of the number it should display john smith supervisor is chris small and mike harris supervisor is john smith. 0 indicates they dont have a supervisor.How do I write this query? I keep getting a cross join when I do a simple join on ID and SupervisorID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top