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 is deploy, process and build? : sql server analysis services, ssas

0 Answers  


What is the purpose of floor function?

0 Answers  


What are subqueries in sql server?

0 Answers  


What does asynchronous call backs means?

0 Answers   Alcatel-Lucent,


How to generate create table script on an existing table in ms sql server?

0 Answers  






How do I find sql server instance name?

0 Answers  


What is the contrast between sql and mysql?

0 Answers  


Write a query to delete duplicate records in SQL SERVER

36 Answers   Infosys,


What is row by row processing ?

2 Answers  


Mention the differences between local and global temporary tables.

0 Answers  


Can we use where clause in union?

0 Answers  


What are the advantages of partitioning?

0 Answers  


Categories