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.
| Author |
Topic |
|
sureshsmanian
Starting Member
31 Posts |
Posted - 2009-10-19 : 07:03:58
|
| hii have two tablesEmployee ( Eno - PK, Ename, Deptno - FK refers the Dept table)Dept (Deptno - PK, Deptname, Mgrno - FK refers the Eno of Employee table)I need the output in the following wayEno Ename Mangername---- ------ ----------------------------------Thanks in advanceRegards SSM |
|
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-10-19 : 10:39:49
|
| [code]SELECT Employee.Eno, Employee.EName, Employee_Manager.EName AS ManagerNameFROM EmployeeINNER JOIN DeptON Employee.DeptNo = Dept.DeptNoINNER JOIN Employee AS Employee_ManagerON Dept.MgrNo = Employee_Manager.Eno[/code]John |
 |
|
|
sureshsmanian
Starting Member
31 Posts |
Posted - 2009-10-19 : 11:08:06
|
| Thanks a lot. It is working fine |
 |
|
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-10-19 : 15:14:14
|
| My pleasure. Welcome aboard.JohnIt's a small world (but I wouldn't want to paint it) |
 |
|
|
|
|
|