March 9, 2004 at 8:43 am
Use the same table with Alias for each field like employees mgr on mgr.id=a.mgr_id , employees emp1 on emp1.id=a.emp1_id so on..
Prasad Bhogadi
www.inforaise.com
March 9, 2004 at 8:57 am
![]()
D'oh! I had a Homer moment!
It makes sense. I just got stuck in one train of thought and I couldn't see the answer right in front of my eyes.
Thanks.
----------------------------------------------------------01010011010100010100110000100000010100110110010101110010011101100110010101110010001000000101001001101111011000110110101101110011
March 9, 2004 at 9:08 am
select a.department,a.mgr_id,b.mgr,a.emp1_id,c.emp1,a.emp2_id,d.emp2
from dept_table a
join employees b
on a.mgr_id = b.emp_id
join employees c
on a.emp1_id = c.emp_id
join employees d
on a.emp2_id = d.emp_id
order by a.department
Just replace emp_id with whatever the column name is in employees that represents the employee ID.
March 9, 2004 at 9:31 am
Exactly I too meant the same, Thanks for elaborating. I believe hawg already has the solution for it.
Prasad Bhogadi
www.inforaise.com
March 9, 2004 at 9:34 am
Yeah, thanks to both of you. I immediately realized the answer with Prasad's response. I just got myself pigeon-holed and missed figuring it out on my own.
Thanks again.
----------------------------------------------------------01010011010100010100110000100000010100110110010101110010011101100110010101110010001000000101001001101111011000110110101101110011
Viewing 5 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply