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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a simple user defined function in ms sql server?

547


What is a dataset and what are the different types of datasets?

93


What is use of except clause? How it differs from not in clause?

606


Explain what are page splits? : SQL Server Architecture

661


What are different types of database indexes?

537






explain databases and sql server databases architecture? : Sql server database administration

525


What are the steps to follow to configure SQL*Net?

565


Can you tell me some of the common replication dmv's and their use? : sql server replication

540


What are the advantages of user defined function?

500


How do I clean up sql server transaction log?

576


What is report server project?

106


What is indexed view? How to create it?

601


Define master database?

585


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

545


What are the mathematical functions supported by sql server 2005?

557