Click here to Skip to main content
15,896,540 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
EMP Table AS Follows;

EMPID  EMPNAME  MGRNo   MGRNAME
 1     Raj      Null     RAvi
 2     Ram       1       Sam
 3     Hari      2       Yogi

from the above EMP Table i wan the output as follows;

I want the output
EMPID  EMPNAME  MGRNAME
 1     Raj       RAvi
 2     Ram       Sam   
 3     Hari      Yogi


For that how to write the query.

[edit]Code block added - OriginalGriff[/edit]
Posted
Updated 25-Nov-12 21:34pm
v2
Comments
Killzone DeathMan 26-Nov-12 4:32am    
Boring!!!
That's to easy!

SQL
Select EMPID,EMPNAME,MGRNAME from EMP

It should work..
 
Share this answer
 
Try:
SQL
SELECT EmpId, EmpName, MgrName FROM Emp
 
Share this answer
 
Select EmbId as EmployeeID,EmpName as EmployeeName,MgrName as ManagerName from Emp
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900