Click here to Skip to main content
Rate this: bad
good
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
Edited 25-Nov-12 21:34pm
v2
Comments
Killzone DeathMan at 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
0 OriginalGriff 344
1 Sergey Alexandrovich Kryukov 337
2 CPallini 180
3 Abdul Samad KP 145
4 Richard MacCutchan 110
0 OriginalGriff 6,329
1 Sergey Alexandrovich Kryukov 5,700
2 CPallini 4,940
3 George Jonsson 3,469
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2014
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