Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Write a SQL query to make a column as unique?

1045


How and why use sql server?

1016


What is the difference between inner join and equi join?

1004


What is a view in sql?

979


How do you delete a trigger?

987


How many types of dimensions are there and what are they? : sql server analysis services, ssas

1074


How will you go about resolving deadlocks?

975


What are the basic functions for master, msdb, model, tempdb databases?

1049


Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)

1891


How to insert data into an existing table?

984


What does the on delete cascade option do?

1019


What are sql server procedures?

989


You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?

908


Mention the different types of triggers?

1120


What is t-sql script to take database offline – take database online.

1090