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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of stored procedure?

520


What options are available to audit login activity? : sql server security

640


How to create a large table with random data for index testing in ms sql server?

540


How to create nested stored procedure?

544


Why are you getting errors when creating a new odbc dsn?

593






You are designing a database for your human resources department in the employee table, there is a field for social security number, which cannot contain null values if no value is given, you want a value of unknown to be inserted in this field what is the best approach?

629


Explain ms sql server reporting services vs crystal reports?

505


What is the parse query button used for?

608


What does the not null constraint do?

585


What is instead of dml trigger?

594


What is the boxing and unboxing concept in .net?

550


Are connections to sql server encrypted?

580


Why it is recommended to avoid referencing a floating point column in the where clause?

542


What are the types of dml?

558


what are the reporting service components in SSRS?

118