| Author: Manvinder Kaur 31 Oct 2009 | Member Level: Bronze | Rating:  Points: 2 |
I did not get your question...
|
| Author: ABitSmart 31 Oct 2009 | Member Level: Diamond | Rating:  Points: 2 |
I think you want this,
select t2.EmployeeName, t3.ManagerName from table1 t1 inner join table2 t2 on t2.id = t1.empid inner join table3 on t3.id = t1.Mid
where, table1 is the table with empid,ename,Mid table2 has employee information id,EmployeeName table3 has manager information id, name
|
| Author: Manvinder Kaur 31 Oct 2009 | Member Level: Bronze | Rating:  Points: 2 |
do not duplicate employee name in two tables....t1 ename and t2 EmployeeName
|
| Author: Manick 01 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
select a.empname, b.mgrname from current_table a inner join foreign_table b on b.empid = a.mid
Regards, Manick
|
| Author: Sridhar 01 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
select e1.empname,e2.empname from tablename e1, tablename e2 where e1.mgrid = e2.empid
|
| Author: Christopher 02 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
you have to use Self join for this query
query is
select a.empid,a.empname as Managername from employeedetails a join employeedetails b on a.managerid=b.empid
|