Member of the LearnItFirst.com Video Training Network | LearnSqlServer.com | SQL SSIS Training | SQL Programming Tutorials |
LearnSqlServer.com Forums LearnSqlServer.com
Welcome Guest Search | New Posts | Members | Log In | Register

Join Query Help Options
ashasivan
Posted: Wednesday, July 25, 2007 4:32:11 AM
Rank: Newbie

Joined: 7/25/2007
Posts: 1
Points: 3
Location: Bangalore
Hi,

I have a table with following fields..

tblEmployee


EmpID int,
EmpName char(20),
MgrID int


I want the name of all employees and names of correspoding managers..

Please help me as soon as possible..

Thanks in Advance..


Regards,

Asha Sivan
Scott Whigham
Posted: Saturday, July 28, 2007 7:49:13 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 345
Points: 748
Location: Dallas, TX
Just a standard parent-child relationship:

SELECT e.*, mgr.EmpName as ManagerName
FROM tblEmployee e JOIN tblemployee mgr
ON e.MgrId = mgr.EmployeeId
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
     
Don't Forget!
LearnItFirst.com
Don't Forget!
LearnWindows2003.com
 
Home | About Us | Support | Contact Us | Privacy | Site Map | Blogs Blogs Refer a Friend and Get a Free Subscription!
© Copyright 2004-2007 LearnItFirst.com LLC. All rights reserved. All trademarks remain the property of their respective owners.
This site is not affiliated in any way with the Microsoft Corporation.