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 to recover from sql injection? : sql server security
Which are the olap features?
What is the main difference between ‘between’ and ‘in’ condition operators?
What are the system database in sql server 2005?
What number sorts of privileges are accessible in sql?
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
What is normalization 1nf 2nf 3nf?
Explain a join?
How to transfer a table from one schema to another?
What is a group function explain with an example?
Explain features and concepts of analysis services?
What are the advantages of using cte?
How column data types are determined in a view?
role of sql sever 2005 in database rather than any other database
What is the difference between a stored procedure and a user defined function?