table:employee
EID ENAME MID(manager ids)
101 rama null
102 sita 101
103 siva 101
104 ganesh 103
. . .
. . .
for 103 ID the manager ID is 101(RAMA) and for 104 manager
is SIVA
if i give employee id (EID) you have to tell the manager for
that EID write query?
eample:if i give 102 .The query output should be manager for
102 ID that it should print RAMA as output
Answer Posted / samba shiva reddy . m
this will also works for u change is id in inner join
select emp1.ename from employee emp1
inner join employee emp
on emp1.eid=emp.mid
where emp.eid=102
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is raid? : Sql server database administration
What are the different types of locks in the database?
query processing
What is delete query?
What is best institute to Learn DotNET And SQL in chennai?
What is service broker? : sql server database administration
What are click through reports?
What is the use of commit?
What is SQL Azure Firewall?
What is the purpose of the model database?
Can you explain the disadvantages/limitation of the cursor?
What are the differences between substr and charindex in sql server.
Which table keeps information about stored procedures?
What is the difference in accessing db between sql server vs sql azure?
What is the function of inner join?