i have a table like this
Eno ename
1 a
2 b
3 c

i want to display ename and bossname from table
hint boss is also an employee

Answers were Sorted based on User's Feedback



i have a table like this Eno ename 1 a 2 b 3 c i want to display ename and bossna..

Answer / saket

self join

Is This Answer Correct ?    6 Yes 0 No

i have a table like this Eno ename 1 a 2 b 3 c i want to display ename and bossna..

Answer / sonia sharma

/---- You need one more column to view manager of each emp
suppose Mno is the column which contains corresponding Eno
as manager id--

select emp.ename , mgr.ename from empTable as emp
inner join empTable as mgr on emp.Mno = mgr.Eno

Is This Answer Correct ?    3 Yes 1 No

i have a table like this Eno ename 1 a 2 b 3 c i want to display ename and bossna..

Answer / mahesh (ezeesoft)

/---- You need one more column to view manager of each emp
suppose Mno is the column which contains corresponding Eno
as manager id--

select emp.ename , mgr.ename from empTable as emp
SELF JOIN empTable as mgr on emp.Mno = mgr.Eno

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are a scheduled jobs or what is a scheduled tasks?

0 Answers  


Can anybody explain me cold backup and hot backup?

3 Answers   TCS,


What is acid properties?

0 Answers  


What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008

2 Answers   IBM,


Explain DBMS, RDBMS?

6 Answers  






How can we delete a table in sql server?

0 Answers  


what are the new features of sql server 2005?

8 Answers   HP, Keane India Ltd,


What is the difference between a function and a stored procedure?

0 Answers  


Diffrence between DTS vs SSIS

2 Answers   IBM, Infosys,


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

0 Answers  


what is trigger . hw will it use them

2 Answers   TCS,


how to get rank of diffrent student in same table based on newly inserted row in sql server2008

4 Answers   ABC,


Categories