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
select emp.ename from employee emp1
inner join employee emp
on emp1.mid=emp.eid
where emp1.eid=102
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
how you can list all the tables in a database?
How do I edit a procedure in sql server?
Explain logical operators in sql server?
What is the stuff and how does it differ from the replace function?
Please explain go command in sql server?
what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration
How do you start single user mode in clustered installations?
How to find the login name linked to a given user name?
Which data type columns are the best candidates for full-text indexing?
What it means to be triggered?
Explain about analysis services?
What is the beast way to write CTE in SQL Server ?
Explain following error properties?
What are the advantages of using stored procedures?
Why is sql server log file full?