|
-
August 11th, 1999, 07:28 AM
#1
Find the EmployeeName and ManagerName
How to list the Employee Name & respective Manager Name from the following table? Since Manager is also an Employee it is given in the same table
EmpId MgrId EmpName
001 100 Murali
002 200 Raja
100 1000 Vasanth
200 2000 Bharath
I want the SQL statement which gives the following result
EmpName MgrName
Murali Vasanth
Raja Bharath
muralirajan
-
August 11th, 1999, 07:36 AM
#2
Re: Find the EmployeeName and ManagerName
try this:
select e.empid, e.empname, e2.empname 'Manager' from empl e
inner join empl e2 on e.mgrid=e2.empid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|