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

What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1234


Does the unique constraint create an index?

1071


What samples and sample databases are provided by microsoft?

1050


How do I view a script in sql server?

1047


Explain primary key, foreign key and unique key?

1000


What is the most common trace flags used with sql server?

1061


What is data compression?

1024


What are the different types of upgrades that can be performed in sql server?

1186


How to update muliple row in single query?

1072


How will you know when statistics on a table are obsolete?

1090


What is data mart? : sql server analysis services, ssas

1065


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

1063


What is the difference between cartesian product and cross join?

872


Explain Geometry datatype in sql server 2008 with example

1002


What is nonclustered index on computed columns?

968