Click here to Skip to main content
12,360,334 members (55,859 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 25-Nov-12 21:32pm
Updated 25-Nov-12 21:34pm
v2
Comments
Killzone DeathMan 26-Nov-12 4:32am
   
Boring!!!
That's to easy!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Select EMPID,EMPNAME,MGRNAME from EMP
It should work..
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Try:
SELECT EmpId, EmpName, MgrName FROM Emp
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Select EmbId as EmployeeID,EmpName as EmployeeName,MgrName as ManagerName from Emp
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100