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...

two tables are there.1st table EMP has two columns ID and name and contains data 1,A
2,B
3,C
2nd table EmpSal has 2 columns ID and Salary
Contains data -1,1000
2,5000
3,3000

Find name of employee having maximum salary ?

Answer Posted / b.kumar

--BY USING MS SQL SERVER

SELECT TOP 1 * FROM
(SELECT DISTINCT TOP 1 #A.ID,#A.NAME,#B.SAL
FROM #A INNER JOIN #B ON #A.ID=#B.ID ORDER BY SAL) E
ORDER BY SAL

--HERE #A, #B ARE TEMP TABLES
--E IS ALIAS NAME

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to call a stored procedure within a stored procedure?

952


What is truncate table?

926


What is a View ? Can we insert, Update and delete a view?

985


What is standby servers? Explain types of standby servers.

982


what is a self join? : Sql server database administration

1016


I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible

2225


What is buffer cash in sql server?

1141


How to get the definition of a stored procedure back?

966


What is the difference between varchar and nvarchar datatypes?

1072


What are distributed partitioned views?

1052


what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

917


What is replication with database mirroring? : sql server database administration

1055


What is format parameter in ssrs?

144


Can binary strings be used in arithmetical operations?

914


What are the joins in sql server? : sql server database administration

993